Attempting to send emails through Gmail's SMTP servers returns "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required"

If you're tying to send emails through Gmail's SMTP servers you may see an error similar to the following The following error is generated by .NET's SMTP client class. 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 at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) For this to work you will need to login to your Gmail account and set the following setting Allow less secure apps: ON Some apps an...