"SMTP Error: Could not authenticate" in PHPMailer
this is GMail issue
read this Google Help (https://support.google.com/mail/answer/14257?p=client_login&rd=1)
- Open your web browser and sign in to Gmail at http://mail.google.com/mail. If you see a word verification request, type the letters in the distorted picture and finish signing in.
- Close your browser and try accessing your messages in your email client again.
- If you're still having problems, visit http://www.google.com/accounts/DisplayUnlockCaptcha and sign in with your Gmail username and password. If necessary, enter the letters in the distorted picture.
- Click Continue.
- Restart your mail client and try accessing messages in your email client again.
I encountered this problem. To get it working, I had to go to myaccount.google.com -> "Sign-in & security" -> "Apps with account access", and turn "Allow less secure apps" to "ON" (near the bottom of the page).
Alternatively you can follow this direct link to these settings