Friday, May 13, 2016

Sending mail in SQL Server 2008 R2 using Gmail SMTP Settings.

I was setting up database Mail in SQL Server 2008 R2 using Gmail SMTP settings (to testing) but not able to send mail as i was facing the below error " 

Message :
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2016-05-13T14:47:58). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at).

To troubleshoot i  tried with Port enabled in firewall, changing port numbers but no luck got failed. Then after googling i find the below steps which made me to send mails successfully. 

 You may simply have to re-verify your client's access via the web. To do that:
However, if you use 2 step verification on your GMail account, don't forget that you will also need an application specific password for your client/device. See http://support.google.com/mail/bin/answer.py?hl=en&answer=1173270 for how to do that

If this doesn't worked then try with sending gmail from client machine if it works ok else enable the java settings in browser options. 

1 comment: