Sending Email with Microsoft Azure | Twilio

Twilio SendGrid’s v3 APIs expect an API key to be passed in an Authorization header as a Bearer Token. See the Twilio SendGrid v3 API reference for help using your key to send your first email.

The Twilio SendGrid helper libraries all provide a method to set your key, handling the authentication via Bearer Token for you. See the Twilio SendGrid developer documentation for helpful code examples and links to helper libraries in C#, Go, Java, Node.js, PHP, Python, and Ruby.

When using Twilio SendGrid’s SMTP integration, you will set your API key as a password via Basic Authentication. Your username must always be the string, “apikey.” Using the account credentials (username and password) you set up through Azure will fail, so be sure to set your password to the 14 digit API key provided by the Twilio SendGrid App. Your account credentials are separate from the credentials used to authenticate with Twilio SendGrid’s APIs and SMTP services.

username: "apikey"
password: <your-api-key>

Twilio SendGrid requires customers to complete Sender Authentication. This requirement protects your domain’s reputation as an email sender and helps uphold legitimate sending behavior by Twilio SendGrid customers.

Setup includes domain authentication. Twilio SendGrid will provide DNS records that you must add to your domain. For instructions on the domain authentication process, see “How to Set Up Domain Authentication.”

You can upgrade or downgrade your Twilio SendGrid plan to accommodate your email sending needs as they change. If you no longer need the Twilio SendGrid service, you will aslo unsubscribe through the Azure portal.

From your Azure portal’s Subscription overview page, select Resources and click your Twilio SendGrid resource (it is labeled “Contoso” in the following examples).

A detail page will load where you can modify your Twilio SendGrid subscription.

To upgrade or downgrade your plan, select Change plan from the Twilio SendGrid resource detail page. There are two locations where you can select Change plan — selecting Change subscription will allow you to modify your Azure subscription, not your Twilio SendGrid plan.

A modal will open, displaying the available plans with your current plan selected. Select a new plan, and click Change plan. You will see a confirmation message on the page when your plan has been updated.

To unsubscribe from Twilio SendGrid, select Unsubscribe from the Twilio SendGrid resource detail page.

A modal will open asking you to select the reason for ending your subscription. Select an option that best describes your situation, and click Unsubscribe.

You will receive a confirmation message when your subscription has been removed.

If you have unsubscribed from Twilio SendGrid and need the service again in the future, you will need to create a new subscription. If your account has been suspended, you can reactivate the service by paying any outstanding account balance. Once payment has been received, you’ll be able to reactivate your account.

This content was originally published here.