I'm having a little trouble with PHPMailer. Can someone help? Please don't tell me my username and password might be wrong. I triple-checked and they are correct.
The lines of code that I think could be the issue are:
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = '*********@gmail.com';
$mail->Password = '*********';
$mail->setFrom('*********@gmail.com','Name');
The error log output is:
2015-12-31 16:46:17 CLIENT -> SERVER: EHLO nfective.com
2015-12-31 16:46:17 CLIENT -> SERVER: STARTTLS
2015-12-31 16:46:17 CLIENT -> SERVER: EHLO nfective.com
2015-12-31 16:46:17 CLIENT -> SERVER: AUTH LOGIN
2015-12-31 16:46:17 CLIENT -> SERVER: bmZlY3RpdmVAZ21haWwuY29t
2015-12-31 16:46:17 CLIENT -> SERVER: JCNAZDB3MTM=
2015-12-31 16:46:17 SMTP ERROR: Password command failed: 534-5.7.14
Please log in via your web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/answer/78754 w32sm33173561qgw.6 - gsmtp 2015-12-31 16:46:17 SMTP Error: Could not authenticate. 2015-12-31 16:46:17 CLIENT -> SERVER: QUIT 2015-12-31 16:46:17 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting bool(false)
It could also be GMail's authentication is beyond the capabilities of PHPMailer. I'm not sure.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…