Archive

Archive for June, 2011

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)
%d bloggers like this: