How to Enable the Microsoft SQL Server Database Mail Feature

Microsoft SQL ServerI’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:

SSMS Database Mail popup menu

On the Welcome page, click Next:

Database Mail Configuration Wizard: Welcome

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:

Database Mail Configuration Wizard: Select Configuration Task

You’ll be prompted that the Database Mail feature is not enabled and to confirm you want to enable it; click Yes:

Confirmation message box

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:

Database Mail Configuration Wizard: New Profile

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:

New Database Mail Account

With the database mail account has been created, click Next:

Database Mail Configuration Wizard: New Profile

Set the profile to Public and click Next:

Database Mail Configuration Wizard: Manage Profile Security

Check the system parameters and click Next:

Database Mail Configuration Wizard: Configure System Parameters

Check the actions you’ve selected and click Finish:

Database Mail Configuration Wizard: Complete the Wizard

The selected actions will be performed and a status displayed:

Database Mail Configuration Wizard: Configuring...

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.

Your Name

Your Email

Suggested Topic

Suggestion Details

2 thoughts on “How to Enable the Microsoft SQL Server Database Mail Feature

    1. Ian Grieve says:

      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

Leave a Reply

Your email address will not be published. Required fields are marked *