I’ve done work for a few clients recently where I’ve created stored procedures or triggers in SQL Server which needed to send email. One of them was for a Microsoft Dynamics GP client where they wanted to send an email when a PR was converted to PO; sending emails in tis way uses a part of SQL Server called Database Mail.
Database Mail is installed but not configured by default, so using it requires that it be configured. I’ve not done this personally myself until recently when I needed to configure my demo VM to send this type of custom workflow notifications.
To enable Database Mail launch SSMS and connect to the SQL Server. Expand the Management node and right click on Database Mail and select Configure Database Mail:
On the Welcome page, click Next:
The configuration task we want is to Setup Database Mail by performing the following tasks…” so make sure this radio button is marked and click Next:
You’ll be prompted that the Database Mail feature is not enabled and to confirm you want to enable it; click Yes:
You need to create a profile for use with Database Mail. Enter a Profile Name and Description and click the Add button to add a Database Mail Account:
The database mail account has a number of details which need to be provided:
- Account name
- Description
- E-mail address
- Display name
- Reply e-mail
- Server name
- Port
- If the SMTP server requires a secure connection
- Authentication method
- If Basic Authentication is needed:
- User name
- Password
- Confirm Password
Once you’ve entered the details, click OK:
With the database mail account has been created, click Next:
Set the profile to Public and click Next:
Check the system parameters and click Next:
Check the actions you’ve selected and click Finish:
The selected actions will be performed and a status displayed:
With Database Mail enabled and configured, you’ll be able to use the feature to send emails from SQL Server.
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.
Thanks for your article, will this still work after October 1st ?
https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online
Hi Terry,
I think SMTP authorization will remain available to those people currently using it after the change, which (again I think) means that database mail would continue to work.
The article you linked seems to support this view, but I’ll admit I’m not an expert in the area of O365.
Ian