Live with Dot Net Just another Programming weblog

SQL Server – How to Configure Database mails

Posted on November 28, 2011

Below are the steps to configure the Database mailing feature in the SQL Server 2008 Database.

The mail can be triggered through a Stored Procedure call. The mails are queued and deliverd using the SMTP Push mail servers.

Steps:

1. In Sql Server database server, Go to Management --> Database Mail.
2. Right click the Database Mail and click on 'Configure Database mails'
3. First we need to create a 'Account' - Click on 'Create new Account'
Account Name :
Email Address : Mailing will be delivered with this mail id as 'From field'
Sever name : SMTP Server name
Port number : 25
Authentication : Basic/Windows (any valid account in the SMTP server domain)
4. Second we need to create a 'Profile' - Click on 'Create new Profile'
Profile Name :
SMTP accounts : Add the create account to the list
5. Now you could you the Profile created to trigger database mail from Stored Procedure,
You can use the below statement inside the SP to trigger the mail

EXEC msdb.dbo.sp_send_dbmail
@recipients='abc@gmail.com',
@body='Test message',
@sensitivity ='Personal',
@importance ='High',
@body_format ='HTML',
@subject ='Test mail',
@profile_name =;

About admin

No description. Please complete your profile.
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.