The Ops Community

Kithmini Indimagedara
Kithmini Indimagedara

Posted on

Azure Email, What is it?

Third-party solutions, such as SendGrid, offer email services on Azure that may be incorporated into solutions to address a wide range of use cases. For example, if we need a low-cost, low-maintenance solution and have an Azure subscription, we can use the SendGrid Email Delivery Service on Microsoft Azure.

Because Microsoft blacklists all Azure IPs, sending emails from Azure using SMTP without a relay does not guarantee that they will be received at the other end. As a result, we discovered that none of our email traffic, both inbound and outbound, was reaching its destination. In general, Azure email sending is dependent on a third-party SMTP relay service. SendGrid is the most popular and recommended tool for this. There are various examples and instructions available on how to post emails using Azure and SendGrid. At the same time, we can use another SMTP relay-compatible service, such as Elastic Email, Mailjet, or SocketLabs.

SendGrid is the most widely utilized email provider for sending emails from Azure. SendGrid and Azure have grown highly popular because they used to be a free plan with a monthly limit of 25,000 emails for Azure members. Despite the fact that the free plan is no longer visible in the Azure interface, Microsoft confirmed that a free membership with a daily limit of 100 emails is still available.

Some of SendGrid's most common features and functions are as follows:

  • Automatic receipt distribution
  • Managing mailing list distribution lists
  • Obtaining data in real time.
  • Inquiries from customers are forwarded.
  • Managing incoming e-mails

Similar functionality is provided by two Azure services:

  1. Queue storage is a messaging service in the cloud that allows Azure application components to communicate with one another.
  2. Service Bus is a robust messaging system for linking applications, services, and devices. By employing the appropriate Service Bus relay, Service Bus can also connect to remotely hosted applications and services.

SendGrid covers all technical specifications, from architecture to ISP outreach and monitoring to filtering services and real-time analytics. As a result, it is the world's leading cloud-based email delivery company.

The email services provided by SendGrid can be used in a variety of ways. However, it is fully depending on your needs and objectives. Here's how to set up and utilize SendGrid on Azure:

Before you begin, please ensure that you have an active SendGrid account in your Azure subscription.

By following the instructions below, you can create a SendGrid account and obtain the information you need to send an email using SendGrid.

  1. Access your Azure account.

  2. Look for the 'SendGrid Email Delivery' service.

The following step is to navigate to the Single Sender Verification page and search for the modified sender address.

Locate the email sent to the sender's address, as seen in the screenshot below, to verify the sender. Then, on the Verify Single Sender button, validate the identity of the sender.

To send email using SendGrid, the following requirements must be met.

  1. SendGrid's SMTP server IP address is smtp.sendgrid.net.
  2. apikey will always be the SMTP security username.
  3. As your password, enter the value of the API key we generated in SendGrid.
  4. Port 25 should be avoided. Alternatively, port 587 can be used.
  5. The recipient of the emails can only be the SendGrid authorized sender address.
$sendGridApiKey = 'SG...........P258'
$SendGridEmail = @{
From = 'bagya@lzex.ml'
To = 'kithmini@gmail.com'
Subject = 'Hello'
Body = 'A formal mail from the account'
SmtpServer = 'smtp.sendgrid.net'
Port = 5123
UseSSL = $true
Credential = New-Object PSCredential 'apikey', (ConvertTo-SecureString $sendGridApiKey -AsPlainText -Force)
}
Send-MailMessage @SendGridEmail
Enter fullscreen mode Exit fullscreen mode

To validate email deliverability, look in the recipient's inbox for the text message we sent. The final result would look like this. As can be seen, the message was sent from the sender's address using sendgrid.net.

Discussion (0)