2017-05-31 92 views
0

嘗試通過Office365與Swiftmailer和Office 365發送郵件失敗再次

發送電子郵件在Swiftmailer 5.x的這是一個相當而工作穩定:

mailer_transport: smtp 
mailer_host: smtp.office365.com 
mailer_port: 587 
mailer_user: [email protected] 
mailer_password: mypassword 
mailer_encryption: tls 

,仍然是在任何最近的答案/文章中,我發現,但

這個提議的解決方案,現在其結果是:

未捕獲的PHP異常Swift_TransportException:「無法在使用用戶名」[email protected]「的SMTP服務器上進行身份驗證,使用1個可能的身份驗證器」 at .../vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php line 181

當然,我重新認識到用戶名/密碼是正確的,我可以用其他方式使用這些憑據發送郵件。

+0

你看過[這個問題](https://github.com/swiftmailer/swiftmailer/issues/497)嗎?有人有同樣的問題,但沒有回答,也許你可以從他們那裏得到幫助 – kero

回答

0

你檢查了地址FROM嗎?

$message = \Swift_Message::newInstance() 
       ->setSubject('Subject') 
       ->setFrom('[email protected]')