Hi friends, One day morning I was configuring SQL Database Mail in SQL Server 2014 installed on my laptop.I tried to send SQL test mail but when i login into my gmail account and checked inbox ,i couldn’t find any mail.So i checked Database Mail log to find error message.
” The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1. 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).) ”
So i planned to fix SQL Mail error using below steps
Step 1.Make sure that you have configured SQL Database Mail in proper way.Please check each steps as explained in my another blog
Step 2.You have to give valid mail id as User name and correct Password in in Password and Confirm password columns at the time of mail configuration
Step 3.Make sure that you have ticked The server requires a secure connection(SSL) as shown in the below picture
It is the fix for “The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required” error message .
Step 4.If above three steps not working in your SQL Database Mail ,Please log into sending email id and check that you got a Gmail critical security alert mail as shown below
Please open above mail and Click on Check activity button
You may click on Yes,it was me as shown in below image
Now please send SQL test Mail again and check it weather it works .if you still get same error, go to next step
Step 5.Make Less secure app access to ON State in your Gmail account(sending email id )
1. Login in to Gmail
2.Switch Allow less secure apps to ON state
Now Check by sending a test mail from your SQL Database Mail using your Mail Profile .
I hope any of five steps mentioned above will help your Database Mail not sending error problem.If you have any alternate solutions please comment below .it will help a lot of SQL DBA students around the world