PHPmailer - Smtp Error: Password Command Failed When Send Mail from My Server

SMTPError: Password command Failed PHPMailer

Well, after a long battle I somehow managed to solve this. I activated DisplayUnlockCaptcha from the following URL:
https://accounts.google.com/b/0/DisplayUnlockCaptcha

Probably because Gmail might have viewed the logins received from PHP file lying in hosting server as untrusted requests. This is because the hosting servers may reside in different places or countries and the login authentication request received would appear different other than the one from where the Gmail account is logged in frequently. So as a security measure, it would have use some captcha mechanism in the background (which which cannot be viewed)

PHPMailer - SMTP ERROR: Password command failed

From your received answer: "invalid LOGIN encoding"... empty passwords decoded by that host results in something else than empty.

Looking at class.smtp.php (line 245):

fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);

your empty string is encoded

and line 256:

echo "SMTP -> ERROR: " . $this->error["error"] .": " . $rply . $this->CRLF;

indicates than the message is created from the host, not the program.

My guess is not, it is not possible use empty passwords.

BTW, I never saw an email account without a password.

HIH,

PhpMailer SMTP ERROR Username command failed: 535 5.7.8

AuthType should solve your problem:

$mail->AuthType = 'LOGIN';

other options include: PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2

https://phpmailer.github.io/PHPMailer/classes/SMTP.html#method_authenticate

phpmailer username & password not accepted

I was able to solve my problem by going here:

https://myaccount.google.com/u/0/lesssecureapps

And set the Allow Secure Apps to On.

Once I made this update, I was able to send the email.



Related Topics



Leave a reply



Submit