Skip to content

How to Configure Database Mail in SQL Server 2008 R2?

In this article we will talk about configuration of Database mail feature in SQL Server 2008 R2. This feature was first introduced in SQL Server 2005. So, same steps will work for SQL Server 2005 and 2008 also.

Before we start the configuration make sure we have SMTP server details, which we can use to send emails form SQL Server. Also, we have enabled the database mail feature. In order to do that either we can run the below script: –

sp_configure ‘show advanced options’, 1;




sp_configure ‘Database Mail XPs’, 1;




sp_configure ‘show advanced options’, 0;




Or, just start the configuration steps below and at the very first point, configuration wizard will show a window stating Database mail feature is not enabled, click yes to enable the feature.

NOTE: – We have already enabled the database mail feature before we started the below configuration. So, we didn’t get the window stating Database mail feature is not enabled.


1) Connect to SQL Server instance from SSMS and navigate to Management a Database Mail. Right click on Database Mail and click on Configure Database Mail option.

2) Here select the first option “ Setup database mail…..” and move to next step.

3) Type the desired profile name and profile description. Then click on Add button to add the SMTP accounts to this profile.

4) Since this is the first profile we are creating, there will not be any Account name available. Here click on New Account to create a new account.

5) Provide the below details: –

Account Name –> Desires account name for this SMTP account

Description –> Description of the account

E-mail address –> Email account from which emails will be sent. When recipient receives email, the sender email is shown as this address.

Display Name –> Name associated with the email address

Reply e-mail –> where reply to the emails will be forwarded.

Server name –> Provide the SMTP, which is to be used to send emails from SQL Server.

Port Number –> Port number to be used by this account. Default is 25.

SMTP Authentication –> Select the desired authentication to be used and then click OK. Then click Next on new window.

6) This screen will show the public profiles available. We can see Test profile which we created above.

7) This screen will show the private profiles available. We can see Test profile which we created above. You can select the account that you want to associate to private profile.

8) Make necessary changes to the Database mail system parameters and move to next step.

9) Database Mail Configuration Wizard will show the summary of the actions to be performed. Click finish and database mail is configured.

10) You can test the newly configured database mail feature by right clicking on Database Mail and click on Test email. Then select the recipient email and send the test email.


  1. João Gabriel Mazuze says:

    i have configured a database mail, but when i try to send test email, this is not being send.
    i need a help.


    1. admin says:

      What error message are you getting?

  2. Durga says:

    I could not be sent an email from DB Mail Server configuration

    This is the error i am getting:
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2012-08-05T09:53:07). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. rs4sm2733130pbc.0).
    ),2124,2,,8/5/2012 9:53:07 AM,sa

  3. Madhu says:

    Hi .after selecting port no and smtp server name .u can also select SSL check box to send mails.Then you wont get any error …..

  4. bee says:

    Thank you very much. I can do it after I find solution for 3 days. ^_^

  5. Manoj.H says:

    Great it worked .

  6. Girish says:

    In case of GMail, you should check following two things:

    1) Port 587 is not blocked.

    2) While configuring email in SQL Server, in the end of section [Outgoing mail server (SMTP)] there is one checkbox [This server requires a secure connection (SSL)], you should check this checkbox.

    Also make sure to use Basic authentication. Provide your mail id and its password.