Wednesday, September 23, 2015

How to configure SQL Database mail so send emails using Office 365 (Exchange Online)

SQL Server has a feature called database mail. This feature allows the database server to send emails to any external entity using external SMTP server. So how can you use Exchange Online to send database emails without On Premise smtp relay server?
This blog post provides a complete walkthrough on how to configure this (which is basically option 1 from technet article)
1. Open the SQL management studio and connect to your MSSQL Instance
2. Expand the "Management node" and then right click the "Database Mail" node and click "Configure Database Mail"

3. Follow the wizard and the critical part is to configure the access account as per the below screen:
4. Once you configured it you can go ahead and test it
Works great without any On Premise smtp relay!