TechBubbles Microsoft Technology BLOG

Database Mail Configuration in SQL Server 2008 R2

 

This post explains the configuration steps that require to send an email from SQL server 2008 R2. It is useful if we could send an email from SQL Server to our administrators and end users. Database Mail is SQL server component that uses Simple Mail Transfer Protocol (SMTP) to send email messages. After setting up the Database email we can test the email and mail-log.

1. Open the SQL server management studio and expand the Management node under the server

image

2. By default the mail configuration is disabled, we can enable by selecting the Database Mail item under Management. Right click the Database Mail and  Click on Configure Database Mail

image

You will get the following wizard window after clicking on Configure Database Mail option

image

image

Click Yes to enable the Database Mail feature

3. Specify the profile name, description and associated SMTP account information as shown in the following windows

image

Add the SMTP account information by clicking on Add button from above dialogue box. In this case I have used my mail server details. You can replace with your SMTP mail address and credentials. After completion of entering the details in below windows just say ok

image

4. In the next step it will ask whether you want to set this profile as public. If you set this as public then any member under Database Mail role can send email using this profile.

image

5. Click Next in above window to get the Database Mail System parameters window, where you can configure parameter values like retry attempts, types of attachments that you do not want send out by mentioning the extensions of files in filters window.

image

6. You will get the successful configuration message after clicking on next button in above window

image

7. To test the configuration of Database Mail setup, Click on Send Test E-mail option by right clicking on Database Mail item under Management node.

image

you will see the following window. Enter the email address to test the email setup and click Send Test E-mail button.

image

8. To see the log details and status of the email,  you can click on View Database Mail Log option

image

image

image

Now you can use this profile to send an email from Stored Procedure in SQL server. That’s it so simple to configure the Database Email, if you know the SMTP and a valid account name on the server.

Share this post :

About the author

Kalyan Bandarupalli

My name is kalyan, I am a software architect and builds the applications using Microsoft .NET technologies. Here I am trying to share what I feel and what I think with whoever comes along wandering to Internet home of mine.I hope that this page and its contents will speak for me and that is the reason I am not going to say anything specially about my self here.

Add Comment

TechBubbles Microsoft Technology BLOG

Follow me

Archives

Tag Cloud