Hi ,Today i am going to teach you How to enable SQL Database Mail in your SQL Server .I have enabled SQL Database Mail in Microsoft SQL Server 2008 R2 installed on my computer.In all SQL version -SQL Server 2008,SQL Server 2008 R2,SQL Server 2012,SQL Server 2014 ,SQL Server 2016,SQL Server 2017,SQL Database Mail configuration can be done as shown in this article.
First Connect to SQL Server instance ,as shown in above picture .
Then Click Management ->SQL Server Logs ->Database Mail
Right Click Database Mail and Choose Configure Database Mail
you will get a window as shown below
When you click Next button ,you will get a window as shown below image
Please Choose Set up Database Mail by performing the following tasks option and Click Next button then you will get a window as shown below
Now you may click Yes button and you will get a window as shown below
Now let us give values as shown above
Profile name —– SQLMAIL
Description —– SQL Database Mail
Then Click Add button.you will get a window as shown below
Account name —– SQL (you can give any name )
Description—–SQL Database Mail (you can give any description)
E-mail address —–firstname.lastname@example.org (this is your sending email id.SQL Mail is sent from this mail id )
Display name —–SQL Database Mail (you can give any display name.This display name will appear in your mail)
Replay e-mail—–fromemailid@gmail(you will get replay to this mail id from email recipients.if you want to get replay to another email id ,then you can give it here .i choose to get replay mails to same email id .so i gave email@example.com as Replay e-mail)
Server name —–smtp.gmail.com
This server requires a secure connection(SSL) makes enable by tick checkbox as shown in above image
Then choose Basic authentication
User name —– firstname.lastname@example.org
then click OK button ,you will get a new window as shown below
Please click Next button as shown in above picture ,you will get a new window as given below
Please Click Next button ,then you will get another window as shown in below image
Okay now we almost configured SQL Database Mail in SQL Server 2008 R2.Let us send a test mail using SQL Database Mail Profile ‘SQLMAIL‘ which we created in above steps .
Yes,When you click Send Test E-mail ,Mail will send to ‘email@example.com‘ from ‘firstname.lastname@example.org‘.
Okay Now it is time to configure SQL Mail in your SQL Server.