Before starting the blog ,i have to thank Mr.Abdul Fareed he is the man behind the blog
enable database mail using the below command
sp_configure ‘Database Mail XPs’,1
reconfigure with override
You can configure database mail from here.
After configuring database mail you have to change the Gmail setting if you are getting the below error
In settings click on Account Profile.
Click on Sign-in & Security
Go to connected apps & sites
Allow less secure apps:ON
once you have enabled .you will receive a confirmation from in your Inbox and you are done, now you can send email .