Skip to content
Advertisement

“SMTP Error: Could not authenticate” in PHPMailer

I’m using PHPMailer in a Simple Script For Send Email’s Through Gmail, and I’m getting an “Unknown Error” (At least for me!):

SMTP Error: Could not authenticate. Error: SMTP Error: Could not authenticate.

SMTP server error: 5.7.1 Username and Password not accepted. Learn more at 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 p38sm2467302ybk.16

I’ve read about Configure OpenSSL For SSL/TLS Connections, and I did it. Apache And PHP Are properly-Configured (With OpenSSL extension Running in PHP and mod_ssl running in Apache 2.2.16).

This is The PHP Script:

JavaScript

The Username and Password are OK, And I tried in Thunderbird, without any problem. I’ve also Used SSL Authentication and Port 465, getting the same Error.

Advertisement

Answer

Try this instead :

$Correo->Username = “foo@gmail.com”;

I tested it and its working perfectly without no other change

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement