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

This generally happens when you try login from different time zone or IP Address Computer. Your production server and the mail id you have used both are in different time zone. Choose either of these two solutions

Gmail Error :The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required
Following are the possible solutions in order to resolve the error.
1. Incorrect Gmail Username and/or password
First you must check whether the Username and Password supplied are correct.
Though Gmail allows you to sign in with Username instead complete Email but when sending email through code you need to pass the complete Email address as Username.
 
2. SSL setting
Gmail uses secure channel for sending emails and hence you need to enable SSL security while accessing Gmail Mailbox through your application.
In .Net it can be enabled by setting EnableSsl setting of the SmtpClient to True. For more information please refer my article Send email using Gmail SMTP Mail Server in ASP.Net.
 
3. Less Secure Apps setting
If you are sure that your Username and Password are correct, but you are still getting errors then it means that Gmail has blocked your application.
And in such case, you will receive an email similar to what is shown below.