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).