Introduction

In my last article, I talked about why you need a 3rd party SMTP relay service. Today, I want to go over how to set up the SendGrid SMTP Relay Service. There are other options out there, but the process should be pretty similar to what I’m about to describe. First, you have to subscribe to the service. Then, you have to set up some DNS records for your custom domain. Finally, you need to know how to access the service.

Subscribe to the SendGrid service

When I’m writing this article, there are a few different plans that Twilio SendGrid has that could be a good fit for you:

Pricing and Plans | SendGrid

If you already have an Azure subscription, you can easily book the service from Azure and the costs will be charged to your Azure subscription. If you start with the free service, you don’t have to enter any credit card information. I recently tried to register for the free service on the website directly, but that didn’t work. I was able to register from Azure, though.

You can find SendGrid in the Azure marketplace:

You’ll need to enter the required info, choose a subscription and a resource group, and then you can create the service:

You can find your new subscription in the Azure portal. Just click on “Open SaaS Account on publisher’s site” it to get started:

Setup your first domain

Once you’ve created your domain, you’ll need to authorize it. To send from any address in your domain, you’ll need to authenticate the whole thing. I’ll just go over this method in more detail:

Just enter your DNS provider, and then you can click “Next.”

Just enter your domain name and then click “Next.”

Next, you’ll see a list of all the DNS records you’ll need to set up to use the service.

Once you’ve got all the DNS records set up, you can also create a free Valimail account to get insights into your DMARC results.

Create your API key

Once you’ve verified your domain, you’ll need to create an API key to authenticate and send emails through the service.

You’ll need to set the permissions for the new API.

Once you’ve created your API key, you can only copy it once. Be sure to store it somewhere safe, like in a password manager.

Relay E-Mails via the SendGrid service

You’ve got two ways to send emails through SendGrid. I’ll show you both options here:

Web API

You can get guides to send emails via SendGrid from a variety of web services:

Here is a example PowerShell Function I used to send a Test E-Mail:

scriptinglibrary/Blog/PowerShell/Send-EmailWithSendGrid.ps1 at master · PaoloFrigo/scriptinglibrary · GitHub

SMTP Relay

The other option is to send out the E-Mail via SMTP:

You can access the service via smtp.sendgrid.net. Just authenticate with the username “apikey” and the API key you created in a recent step.

Conclusion

In this guide, I’ve shown you how to subscribe to the Twilio SendGrid Service, set up your first custom domain, and send emails via the Web API or SMTP. You can try this service for free as long as you don’t want to send more than 100 email a day.

Hope you liked the article!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Consent Management Platform von Real Cookie Banner