The SMTP server requires a secure connection or the client was not authenticated. if uploading on godaddy
you should enable application to access gmail account. This link will help you
I have the same problem.
I have found this solution:
Google may block sign in attempts from some apps or devices that do not use modern security standards. Since these apps and devices are easier to break into, blocking them helps keep your account safer.
Some examples of apps that do not support the latest security standards include:
The Mail app on your iPhone or iPad with iOS 6 or below The Mail app on your Windows phone preceding the 8.1 release Some Desktop mail clients like Microsoft Outlook and Mozilla Thunderbird Therefore, you have to enable Less Secure Sign-In in your google account.
After sign into google account, go to:
https://www.google.com/settings/security/lesssecureapps
I just encountered the same problem.
Tried Aidin Eslami's answer and it only did part job:
After enabling less secure apps access in here: https://www.google.com/settings/security/lesssecureapps I managed to send emails from my local machine but not from my web host.
And then I found this google support page: https://support.google.com/accounts/answer/6009563
Still having trouble signing in?
If you’ve tried all the options above but are still unable to sign in to your account on the app, try the following:
Go to https://accounts.google.com/DisplayUnlockCaptcha on your device's browser. Enter your username and password, then type the letters on the screen. Go back to the app and try signing in again.
After pressing the button in the DisplayUnlockCaptcha everything works!
Hopes this helps others too. Good luck.