Home > SQL SERVER 2008 > Database Mail – SQL SERVER 2008

Database Mail – SQL SERVER 2008


DATABASE MAIL

In this Article, I would like to show a feature from SQL SERVER 2008 which is used to send mail from the database, its DATABASE MAIL

Let’s see how database mail works, and how to configure it for Gmail server.

Since I don’t have a Domain of my own, I have tried it for Gmail server. Configuring database mail is very simple and similar to your outlook mail configuration. All you have to know are the details of your email service provider that you like to configure. There are many email service providers like hotmail, Gmail, yahoo etc,

In my example, I have shown how to configure your database mail for Gmail Server, it is simple to know the details of your service provider, just Google it and there you are.

 

Email Service providers SMTP server name Port number
Hotmail

smtp.live.com

587
Gmail smtp.gmail.com 587
Yahoo smtp.mail.yahoo.com 25
AOL smtp.aol.com 587

a. table 1

The following screen shots will illustrate the steps in configuring the mail server.

Step 1:

Open Database Mail from Management folder, and click next to continue

image

Step 2:

To step a new account db mail account, select the following option.

image

Step 3:

Give a name to your profile and click ‘Add’ to include a new account to profile.

image

Step 4:

Check in Google about the server name and port number of Gmail and other service providers. Fill the details of your email provider. Please refer the initial table for other email service providers (a. table 1)

image

Step 5:

Click next >,

image

image

image

image

The database mail is now configured for Gmail server,

Note: Check the latest Gmail Server’s port number and server name in Google before configuring these settings.

To test the database mail,  Right click on the Database Mail, and click send test mail.

image

Enter the email id and click OK,

The test option will end up as a mail in your inbox.

then, check the mail’s inbox , the test message will be received.

Uses:

  • Send ETL audit information to mail id’s
  • Send Success/Failure notification on any database process
  • Alerting process through Triggers (whenever insert, delete and update happens)
Advertisements
  1. synaptic rumble
    July 7, 2011 at 10:11 pm

    works perfectly, thanks.

    Like

  2. bolearner
    November 26, 2011 at 7:09 pm

    Hi Dinesh,
    Nice blog. But just wanted to know, when can we use this feature.
    If you write that also then it will be very useful

    Like

    • November 27, 2011 at 12:02 pm

      This feature can be used for Logging in ETL process. When particular load is completed, we can use this feature to send a mail about the success and failure of the load, row count and transaction_log details to the users and developers

      Like

  1. September 24, 2012 at 2:54 am
  2. July 24, 2013 at 4:45 pm

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: