我收到错误:当尝试通过smtp与smtp.office365.com发送电子邮件时,Auth方法请求UNKNOWN。
在https://smtp.office365.com/owa/网站上使用相同的密码和用户名成功登录我的帐户。
我已确认用户名和密码是否正确。
PhpMailer v6使用..代码在这里https://pastebin.com/vteFTsCM
请帮助..
以下是完整的错误日志。
2017-09-25 08:22:48 Connection: opening to smtp.office365.com:587, timeout=300, options=array()
2017-09-25 08:22:48 Connection: opened
2017-09-25 08:22:49 SMTP INBOUND: "220 DB6PR0601CA0011.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 25 Sep 2017 08:22:48 +0000"
2017-09-25 08:22:49 SERVER -> CLIENT: 220 DB6PR0601CA0011.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 25 Sep 2017 08:22:48 +0000
2017-09-25 08:22:49 CLIENT -> SERVER: EHLO localhost
2017-09-25 08:22:49 SMTP INBOUND: "250-DB6PR0601CA0011.outlook.office365.com Hello [197.254.27.214]"
2017-09-25 08:22:49 SMTP INBOUND: "250-SIZE 157286400"
2017-09-25 08:22:49 SMTP INBOUND: "250-PIPELINING"
2017-09-25 08:22:49 SMTP INBOUND: "250-DSN"
2017-09-25 08:22:49 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"
2017-09-25 08:22:49 SMTP INBOUND: "250-STARTTLS"
2017-09-25 08:22:49 SMTP INBOUND: "250-8BITMIME"
2017-09-25 08:22:49 SMTP INBOUND: "250-BINARYMIME"
2017-09-25 08:22:49 SMTP INBOUND: "250-CHUNKING"
2017-09-25 08:22:49 SMTP INBOUND: "250 SMTPUTF8"
2017-09-25 08:22:49 SERVER -> CLIENT: 250-DB6PR0601CA0011.outlook.office365.com Hello [197.254.27.214]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2017-09-25 08:22:49 CLIENT -> SERVER: STARTTLS
2017-09-25 08:22:49 SMTP INBOUND: "220 2.0.0 SMTP server ready"
2017-09-25 08:22:49 SERVER -> CLIENT: 220 2.0.0 SMTP server ready
2017-09-25 08:22:50 CLIENT -> SERVER: EHLO localhost
2017-09-25 08:22:50 SMTP INBOUND: "250-DB6PR0601CA0011.outlook.office365.com Hello [197.254.27.214]"
2017-09-25 08:22:50 SMTP INBOUND: "250-SIZE 157286400"
2017-09-25 08:22:50 SMTP INBOUND: "250-PIPELINING"
2017-09-25 08:22:50 SMTP INBOUND: "250-DSN"
2017-09-25 08:22:50 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"
2017-09-25 08:22:50 SMTP INBOUND: "250-AUTH LOGIN XOAUTH2"
2017-09-25 08:22:50 SMTP INBOUND: "250-8BITMIME"
2017-09-25 08:22:50 SMTP INBOUND: "250-BINARYMIME"
2017-09-25 08:22:50 SMTP INBOUND: "250-CHUNKING"
2017-09-25 08:22:50 SMTP INBOUND: "250 SMTPUTF8"
2017-09-25 08:22:50 SERVER -> CLIENT: 250-DB6PR0601CA0011.outlook.office365.com Hello [197.254.27.214]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN XOAUTH2250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2017-09-25 08:22:50 Auth method requested: UNKNOWN
2017-09-25 08:22:50 Auth methods available on the server: LOGIN,XOAUTH2
2017-09-25 08:22:50 Requested auth method not available:
2017-09-25 08:22:50 Auth method selected: LOGIN
2017-09-25 08:22:50 CLIENT -> SERVER: AUTH LOGIN
2017-09-25 08:22:50 SMTP INBOUND: "334 XXXXXXXXXXXXXXXXXXXXXXXXX"
2017-09-25 08:22:50 SERVER -> CLIENT: 334 XXXXXXXXXXXXXXXXXXXXXXXXX
2017-09-25 08:22:50 CLIENT -> SERVER: XXXXXXXXXXXXXXXXXXXXXXXXX==
2017-09-25 08:22:51 SMTP INBOUND: "334 XXXXXXXXXXXXXXXXXXXXXXXXX"
2017-09-25 08:22:51 SERVER -> CLIENT: 334 XXXXXXXXXXXXXXXXXXXXXXXXX
2017-09-25 08:22:51 CLIENT -> SERVER: XXXXXXXXXXXXXXXXXXXXXXXXX==
2017-09-25 08:22:58 SMTP INBOUND: "535 5.7.3 Authentication unsuccessful [DB6PR0601CA0011.eurprd06.prod.outlook.com]"
2017-09-25 08:22:58 SERVER -> CLIENT: 535 5.7.3 Authentication unsuccessful [DB6PR0601CA0011.eurprd06.prod.outlook.com]
2017-09-25 08:22:58 SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [DB6PR0601CA0011.eurprd06.prod.outlook.com]
SMTP Error: Could not authenticate.
2017-09-25 08:22:58 CLIENT -> SERVER: QUIT
2017-09-25 08:22:58 SMTP INBOUND: "221 2.0.0 Service closing transmission channel"
2017-09-25 08:22:58 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel
2017-09-25 08:22:58 Connection: closed
SMTP Error: Could not authenticate.
Message could not be sent.Mailer Error: SMTP Error: Could not authenticate.