SQL Server – Setup Database E-mail using – T-SQL

By Navratan Verma

Let us quickly learn how to setup database email by using your gmail account.  (Applicable to SQL 2005 onwards)
Download Script Here. SetupDB_Email

Enable the Database email feature.

SetupEmail1

Setup Profile and add account.

SetupEmail2

In case of gmail make sure you enable the option Allow less secure apps : ON
under Sign in and Security -> Connected apps and Sites.

Emailsetup5

Send the Test Email.

SetupEmail3

Finally do a cleanup, remove Logs using Date parameter relevant to your time and delete account and profile.

SetupEmail4

Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *