3 min read

How to send email using Azure

This post will show you how to configure the email service in Azure and how to send emails using SMTP.

The first step is to create the Email Communication Services resource in Azure.

  • Go to the Azure Portal and sign in with your account
  • Select the "Create a resource" button on the Azure services tab
  • Enter "Email Communication Services" in the search box, open the page, and click "create."
  • Complete the required fields in the basics tab and click "Review + create"
  • Click "Go to resource" when the deployment finishes

You can click on the link below to view the official documentation if you have any questions about this process

Quickstart - Create and manage Email Communication Service resource in Azure Communication Service - An Azure Communication Services quickstart
In this quickstart, you’ll learn how to create and manage your first Azure Email Communication Services resource.

Now it's time to set up your own domain

  • In the options on the left, select "Provision domains"
  • Click on "1-click-add" if you have an Azure domain or click on "Setup" to configure a custom domain. For this example, we're going to use the second option
  • In the form that opened, enter your domain name, and click "Add". The domain will be added after some seconds
  • After the domain is added, click on "Verify Domain" to verify your domain with a TXT record
  • To verify your domain, you will need to add a TXT record to your domain's registrar or DNS hosting provider with the values displayed. You can click here for step-by-step instructions
  • Click next once you've completed this step and advance to the end of the form
  • Back to previous screen, click on "Refresh" to show your domain

If everything goes right, you'll see something like the image below. Remember that it can take up to 24 hours for your domain to be validated.

With the domain validated, it's now time to set up three more DNS records.

  • You can click on "Configure" below "SPF Status", "DKIM2 Status" or "DKIM2 status", they all do the same thing. A panel will open on the right with the data to be configured
  • Configure a TXT record for the SPF
  • Configure a CNAME record for the DKIM
  • And finally, configure a CNAME record for the DKIM2. You can click here for step-by-step instructions
  • Click next once you've completed this step and advance to the end of the form

If everything goes right, you'll see something like the image below.

The Email Communication Service setup is complete.
You can check out more details about this process by clicking on the link below to access the official documentation

How to add custom verified domains to Email Communication Service - An Azure Communication Services quick start guide
Learn about adding Custom domains for Email Communication Services.

Now is the time to create the Communication Services resource in Azure.

  • Go to the Azure Portal home
  • Select the "Create a resource" button on the Azure services tab
  • Enter "Communication Services" in the search box, open the page, and click "create."
  • Complete the required fields in the basics tab and click "Review + create"
  • Click "Go to resource" when the deployment finishes

Now we are going to connect our domain to the "Communication Services"

  • In the options on the left, select "Domains"
  • Click on "Connect domain"
  • In the form that opened, select the domain that whas configured on the "Email Communication Service"
  • Click on "Connect" and the domain will be connected to the "Communication Service"

And with that, the configuration of the "Communication Service" is done. You can access the "Try Email" option on the left to test it.

In the post below, I show you how to use what we've set up to send email using .NET.

How to send email using Azure and .NET
Thoughts, stories and ideas.