我正在使用Laravel作爲網站。我有一個頁面,用戶可以與我聯繫。這使用SwiftMailer包向我發送一封電子郵件。它剛剛被帶到我的注意,下面的錯誤被視爲試圖發送一個消息無法停止在Laravel中向瀏覽器顯示SwiftMailer異常
Fatal error: Uncaught exception 'Swift_TransportException'
異常從這裏/Applications/MAMP/htdocs/yooies_site/bundles/swiftmailer/library/classes/Swift/Transport/Esmtp/AuthHandler.php on line 176
在這個位置
守則時拋出:
throw new Swift_TransportException(
'Failed to authenticate on SMTP server with username "' .
$this->_username . '" using ' . $count . ' possible authenticators'
);
的錯誤的原因不是一個擔心(我發現我改變了我的郵件密碼,並忘記在我的網站電子郵件配置中更改)
問題I有Laravel設置記錄任何異常,而不是顯示在主頁上。我有我的error.php配置文件中的以下設置
'detail' => false,
'log' => true,
爲什麼然後我的網站顯示頁面上的異常,而不是500錯誤?
這裏完整的堆棧跟蹤(注意:我已刪除了我的網站的真實姓名,並與 '現場'
Fatal error: Uncaught exception 'Swift_TransportException' with message 'Failed to authenticate on SMTP server with username "info+site.com" using 2 possible authenticators' in /Applications/MAMP/htdocs/site/bundles/swiftmailer/library/classes/Swift/Transport/Esmtp/AuthHandler.php:176 Stack trace: #0 /Applications/MAMP/htdocs/site/bundles/swiftmailer/library/classes/Swift/Transport/EsmtpTransport.php(307): Swift_Transport_Esmtp_AuthHandler->afterEhlo(Object(Swift_SmtpTransport)) #1 /Applications/MAMP/htdocs/site/bundles/swiftmailer/library/classes/Swift/Transport/AbstractSmtpTransport.php(124): Swift_Transport_EsmtpTransport->_doHeloCommand() #2 /Applications/MAMP/htdocs/site/bundles/swiftmailer/library/classes/Swift/Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start() #3 /Applications/MAMP/htdocs/site/application/libraries/personal/mailer.php(55): Swift_Mailer->send(Object(Swift_Message)) #4 /Applications/MAMP/htdocs/site/application/config/error.php(91): Personal\Mai in /Applications/MAMP/htdocs/site/bundles/swiftmailer/library/classes/Swift/Transport/Esmtp/AuthHandler.php on line 176
Laravel版本是L3更換。
捆綁URL這裏http://bundles.laravel.com/bundle/swiftmailer
假設Laravel將不得不做一些事情,因爲這個異常沒有被捕獲 - 即使Laravel要做自己的catch,它也不能完成控制器中的代碼。如果你在現場,你可以用'try'打包電話並記錄下來,如果你在開發中,你可以重新'扔掉'嗎? – halfer
事情是,Laravel已經處理了這個,但由於某些原因,不適用於這個快速郵件例外。我更願意在laravel中找到根本原因並修改以確保異常被捕獲 –
好吧,+1。我對Laravel並不熟悉,但是如果您有任何自己的控制器代碼用於此捆綁包,那麼可能需要編輯它。或者這個捆綁包是獨立工作的嗎? – halfer