more debugs

Friday, November 25, 2011

SQL SERVER – 2008 – Configure Database Mail – Send Email From SQL Database

There are 3 basic steps that need to be carried out. 

1) Create Profile and Account.
2) Configure Email.
3) Send Email.

Step 1) Create Profile and Account:

You need to create a profile and account using the Configure Database  Mail Wizard which can be accessed from the Configure Database Mail context menu of the Database Mail node in Management Node. This wizard is used to manage accounts, profiles, and Database Mail global settings which are shown below:



eMail through MSSQL 2008 Mail service


Figure 1:- sendingMailstep-1


eMail through MSSQL 2008 mail service
Figure 2:- sendingmail-step2
MSSQL 2008 email service
Figure 3:- sendingmail-step3

Send Email through MSSQL 2008 mail service
sendingmail-step4
EMail through MSSQL 2008 mail service
Figure 5:- sendingmail-step5


EMail through MSSQL 2008 mail service
Figure 6:- sendingmail-step6




Step  2) Configure Email.

Upto now your account and profile are created successfully, we need to configure the Database Mail. To Configureit, we may need to enable the Database mail XPs parameter through the sp_configure store procedure, as shown here:

 sp_CONFIGURE 'show advanced',1
GO
RECONFIGURE
sp_CONFIGURE 'Database Mail XPs',1
GO

RECONFIGURE
GO

 Step  3) Send Email.

After  all configuration are done, we are now ready to send an email. To send mail, we need to execute a store procedure sp_send_dbmail and provide the required parameters as show below:

EMail through MSSQL 2008 mail service
sendingmail-step7

No comments:

Post a Comment