Configure SQL Server Agent Mail to Use Database Mail

This topic describes how to configure SQL Server Agent to use Database Mail to send notification and alerts in SQL Server 2014 by using SQL Server Management Studio.

There are two ways that you can setup Database Mail, either by using the stored procedures that are included with SQL Server or by using SQL Server Management Studio.  For this exercise we will walk through how to setup Database Mail by using the GUI. MSSQLServer-1

To setup Database Mail, connect to your server and expand the Management node of the tree and then right click on “Database Mail”.

pic1

pic2

Then select “Configure Database Mail’ and you will get the following welcome screen and the click “Next”.

pic3

The following screen will appear and select “Set up Database Mail by performing…” and click “Next”.

pic4

If Database Mail has not been enabled, you will get this following screen. Just click “Yes” to enable it.  If it has already been enabled this screen will not appear.

pic5

Enter in a name for the Profile and also a description and click “Add…”

pic6

The following screen will appear.  Fill out the details for your mail account that will be used to send out email from SQL Server.  When you are done click “OK”.

pic7

Example for Gmail.com

pic12

After you click “OK” you will be brought back to this screen and the SMTP details will now show for the account you just setup.  Click “Next” to continue.

pic8

Select as default profile for all Pubic and Private Profiles

pic13

On the next screen you will see the name of the profile that you just setup.  Click on the checkbox to allow this to be a Public profile and also select “Yes” for the default profile and then click “Next”.

pic9

The following screen has some additional parameters that can be set to control how mail is sent.  You can make changes or leave the defaults.  When you are done click “Next”.

pic10

A summary screen will appear that shows you all of the options that were selected.  If everything is correct click “Finish” or click “Back” to go back and make changes.

pic11

When you click “‘Finish” the next screen will appear that shows you the status of installing Database Mail. When this has finished just click “Close” to close this screen.

pic12

To test Database Mail, right click on Database Mail and select “Send Test E-Mail”.

pic13

Fill in a “To:” email address and change the body of the email if you want and then click “Send Test E-Mail”.

pic14

pic15

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: