Configure and send E-Mail from SQL Server

Introduction

To build high-trafficked scalable web applications, it is recommended not to stuck your email code in the application code. Instead, we can use SQL Server to send all messages and emails. In this article, we will see how to configure your SQL Server 2008 to send emails. 

Step 1 :

First of all you need to start SQL Server Management Studio. 

And right click on Database Mail and click Configure Database Mail.

img1.jpg

Next step setup database mail.

Step 2

img2.jpg

Now you have to add profile name and profile description and click Add

Step 3

img3.jpg

Now you have to enter account details and click OK.

Step 4

img4.jpg

img5.jpg

Click Next

img6.jpg

Click Next

img7.jpg

Click Next and Finish

img8.jpg

img9.jpg

Now profile and account has been created well now time to configure database mail. To configure database mail first we have to enable database mail XPs parameter using sp_configure stored procedure.

img10.jpg

Now time to send mail.

img11.jpg

To track the mail status and log status execute this query.

img12.jpg

Up Next
    Ebook Download
    View all
    Learn
    View all