我已经使用域名创建了一个 Office 365 管理员帐户。我还在图片中的安全信息显示中启用了我的帐户中的两步验证:
但是,每当我使用此帐户向我发送邮件时,都会出现这样的错误。
2021-02-10 05:33:32 Auth method requested: UNKNOWN
2021-02-10 05:33:32 Auth methods available on the server: LOGIN,XOAUTH2
2021-02-10 05:33:32 Auth method selected: LOGIN
2021-02-10 05:33:32 CLIENT -> SERVER: AUTH LOGIN
2021-02-10 05:33:32 SMTP -> get_lines(): $data is ""
2021-02-10 05:33:32 SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6
"
2021-02-10 05:33:32 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2021-02-10 05:33:32 CLIENT -> SERVER: xxx
2021-02-10 05:33:32 SMTP -> get_lines(): $data is ""
2021-02-10 05:33:32 SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6
"
2021-02-10 05:33:32 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2021-02-10 05:33:32 CLIENT -> SERVER: xxx
2021-02-10 05:33:37 SMTP -> get_lines(): $data is ""
2021-02-10 05:33:37 SMTP -> get_lines(): $str is "535 5.7.3 Authentication unsuccessful [PN0PR01CA0004.INDPRD01.PROD.OUTLOOK.COM]
"
2021-02-10 05:33:37 SERVER -> CLIENT: 535 5.7.3 Authentication unsuccessful [PN0PR01CA0004.INDPRD01.PROD.OUTLOOK.COM]
2021-02-10 05:33:37 SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [PN0PR01CA0004.INDPRD01.PROD.OUTLOOK.COM]
2021-02-10 05:33:37 SMTP Error: Could not authenticate.
2021-02-10 05:33:37 CLIENT -> SERVER: QUIT
2021-02-10 05:33:38 SMTP -> get_lines(): $data is ""
2021-02-10 05:33:38 SMTP -> get_lines(): $str is "221 2.0.0 Service closing transmission channel
"
2021-02-10 05:33:38 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel
2021-02-10 05:33:38 Connection: closed
2021-02-10 05:33:38 SMTP Error: Could not authenticate.
<br />
<b>Fatal error</b>: Uncaught phpmailerException: SMTP Error: Could not authenticate. in C:\xampp\htdocs\dede\PHPMailer\class.phpmailer.php:1714
Stack trace:
#0 C:\xampp\htdocs\dede\PHPMailer\class.phpmailer.php(1557): PHPMailer->smtpConnect(Array)
#1 C:\xampp\htdocs\dede\PHPMailer\class.phpmailer.php(1340): PHPMailer->smtpSend('Date: Wed, 10 F...', 'This is a multi...')
#2 C:\xampp\htdocs\dede\PHPMailer\class.phpmailer.php(1215): PHPMailer->postSend()
#3 C:\xampp\htdocs\dede\register.php(187): PHPMailer->send()
#4 {main}
如何使用两步验证发送 SMTP 邮件?我还创建了两个活动用户,例如 user1 和 user2。如果我想使用该用户发送 SMTP 邮件,我该怎么办?