Configure and Send E-Mail From SQL Server

Here you can see how to configure and send mail from SQL Server.

Step 1: Open SQL Server then open Object Explorer then select "Management" -> "SQL Server Logs" then right-click "Database Mail" then click "Configure Database Mail".

configure database mail
                                                                                       Image 1

mail configure wizard
                                                                           Image 2
Click "Next >".

select configure task
                                                                           Image 3
Click "Next >".

server management studio
                                                                           Image 4

Step 2: Here enter a Profile Name and Description and click Add.

new profile
                                                                                 Image 5

new database mail account
                                                                                 Image 6

SMTP Account
                                                                              Image 7

manage profile security
                                                                                 Image 8

configure system parameters
                                                                              Image 9

complete the wizard
                                                                           Image 10

configuring
                                                                           Image 11

Step 3: Now the profile and account have been created and we will configure the database mail using the following Stored Procedure.

sql query
                                                                                 Image 12

Step 4: Now using the following Stored Procedure we will send mail.

query for sending mail
                                                                                 Image 13

Step 5: Now we can track the status of the mail.

status of mail
                                                                               Image 14


Similar Articles