“SMTP Error: Could not authenticate” in PHPMailer

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

enter image description here

Leave a Comment