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


Recently it appears that gmail has changed their security and some of my code to send mail messages started receiving the following exception even though I was connecting with SSL:

The SMTP server requires a secure connection or the client was not authenticated.
The server response was: 5.5.1 Authentication Required

The problem can be fixed by allowing "less secure apps" in your account settings. You can navigate to: https://www.google.com/settings/security and then enable "Access for less secure apps" and this exception will go away (and your mail will start sending again).

Leave a comment

Please note that we won't show your email to others, or use it for sending unwanted emails. We will only use it to render your Gravatar image and to validate you as a real person.