Recently setup outbound SMTP in an Azure SharePoint farm. There is great documentation (https://azure.microsoft.com/en-us/documentation/articles/sendgrid-dotnet-how-to-send-email/) out there already, but figured I’d share my experiences with it.

Included in Azure is a cloud-based email service called SendGrid. You get 25,000 email credits free a month. Here’s the rest of the pricing: https://sendgrid.com/windowsazure.html

Once this service is created in your environment (Click the first link to get the walkthrough) you will be assigned a username/password for SMTP relay. Make note of this since you’ll be using it later on.

After the SendGrid service is spun up you still need a way for SharePoint to use this. Pointing the outbound email configuration at smtp.sendgrid.com will not work because SendGrid requires a username/password. Good thing SendGrid has some good documentation too: https://sendgrid.com/docs/Integrate/Mail_Servers/iis75.html

After configuring the SMTP Server feature on the SharePoint server (You could use a separate server for relay, but this was dev so I was playing) I tested first with Telnet (Using the example in the SendGrid documentation) and then with PowerShell to verify everything was working in SharePoint.

The documentation is good so follow that, but I did run into 2 items that weren’t discussed:

  1. Add your domain as an alias domain in SMTP
  2. The IP Address of 127.0.0.1 does not work
    • In SMTP > Right Click the SMTP Virtual Server # 1> Properties > Access > Relay Restrictions
    • Click the Relay button and note that 127.0.0.1 is added (Per SendGrid instructions). This needs to be switched to the IP Address of the Azure server

Here’s the PowerShell example: