Saturday, April 18, 2015

GMAIL Error: The SMTP server requires a secure connection or the client was not authenticated

In this article I will explain how to resolve the error The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required in ASP.Net Application.

Error
The following error occurs when you try to send email using Gmail credentials in your ASP.Net application.
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
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Mail.SmtpException: 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



Less Secure Apps setting:
if you have not received email then use the following link.
https://www.google.com/settings/security/lesssecureapps

  
as above link click on Access for less secure apps Turn ON then again Run your Code Send Email Code.


1 comment: