7
 How to configure SQL Server Database Mail to send email using  your Windows Live Mail Account or your GMail Account If you are using SQL Server 2005 or higher, you might have noticed that there is now a “Database Mail” (DB Mail) option under “Management”. This is very different from the “SQL Mail” that we had on previous versions (it still exists under Management\Legacy). Using DB Mail, you no longer have to configure a mailbox on your machine, and you certainly do not need to run the SQL Server or the SQL Server Agent under the account you want to send emails from. Moreover, you can have multiple mail profiles and you can decide which account to use under various conditions.  So, here we go on the steps to configure DB Mail:  1. Right-Click on Database Mail and choose Configure Database Mail. 2. This starts the Database Mail Configuration Wizard. Click Next. 3. In the Select Configuration Task screen, choose “Set up Database Mail by performing the following tasks:” and click “Next”.

DBMAIL-database

  • Upload
    someone

  • View
    213

  • Download
    0

Embed Size (px)

DESCRIPTION

sql server

Citation preview

  • How to configure SQL Server Database Mail to send email using

    your Windows Live Mail Account or your GMail Account

    If you are using SQL Server 2005 or higher, you might have noticed that there is now a Database

    Mail (DB Mail) option under Management. This is very different from the SQL Mail that we had on

    previous versions (it still exists under Management\Legacy). Using DB Mail, you no longer have to configure

    a mailbox on your machine, and you certainly do not need to run the SQL Server or the SQL Server Agent

    under the account you want to send emails from. Moreover, you can have multiple mail profiles and you can

    decide which account to use under various conditions.

    So, here we go on the steps to configure DB Mail:

    1. Right-Click on Database Mail and choose Configure Database Mail.

    2. This starts the Database Mail Configuration Wizard. Click Next.

    3. In the Select Configuration Task screen, choose Set up Database Mail by performing the

    following tasks: and click Next.

    http://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail01_2.png

  • 4. Now, you will be required to enter a Profile Name. This can be any Arbitrary Name that will help you identify

    the Profile. You might also want to add a Description. Now, click on Add.

    http://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail02_2.pnghttp://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail03_2.png

  • 5. Now, you are prompted to create a New Database Mail Account. Enter any Account Name andDescription.

    The other parameters are as follows:

    o For configuring Windows Live Mail:

    Email address: Your Live e-mail ID

    Display name: Your name

    Reply e-mail: Any reply-to email account

    Server name: smtp.live.com

    Port number: 25

    This server requires a secure connection (SSL): Checked ON

    In the next section, choose Basic Authentication and enter the following information:

    User name: Your Live e-mail ID

    Password: Password for your Live e-mail ID

    Confirm password: Password for your Live e-mail ID

    The configuration should look like the screenshot below. Now, click OK.

    o For configuring Google Mail (Gmail):

    Email address: Your Gmail ID

    Display name: Your name

    Reply e-mail: Any reply-to email account

    Server name: smtp.gmail.com

    Port number: 587

    This server requires a secure connection (SSL): Checked ON

    (Settings looked up from Gmail Help)

    In the next section, choose Basic Authentication and enter the following information:

    User name: Your gmail ID

    http://mail.google.com/support/bin/answer.py?answer=86374http://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail04_2.png

  • Password: Password for your gmail ID

    Confirm password: Password for your gmail ID

    The configuration should look like the screenshot below. Now, click OK.

    6. Back on the New Profile screen, click Next. The next Manage Profile Security screen allows you to set

    the Public Profiles, the Private Profiles and the Default Profiles for each of the Public and Private Profiles.

    http://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail05_2.png

  • 7. Click Next. This will move us to the Configure System Parameters screen. You may want to tweak the

    parameters; however, for demonstration purposes, we will keep these as default. Now, click Next.

    http://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail06_2.pnghttp://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail07_2.png

  • 8. In the Complete the Wizard screen, review the parameters and click Finish. Ensure that all the 5 Actions

    succeed and then click Close.

    9. Your DB Mail should now be configured successfully and you should be all setup to send emails using DB Mail.

    But before we confirm success, we will like to send a test email and confirm receipt. To do that, right-click

    on Database Mail and choose Send Test E-Mail

    http://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail08_2.pnghttp://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail09_2.png

  • 10. Enter a To: email id and click Send Test E-Mail.

    11. You should receive the email in a few seconds. If you have received the email, you have been able to configure

    DB Mail successfully, and you can now start using DB Mail.

    http://blogs.msdn.com/blogfiles/suhde/WindowsLiveWriter/HowtoconfigureSQLServerDatabaseMailtosen_A9BF/DBMail10_2.png