我得到RFC 2822,3.6.2錯誤(僅在生產中)對於遵循此格式的電子郵件地址:[email protected]
RFC 2822,3.6.2使用Laravel「[email protected]」格式生成電子郵件時出現錯誤
源代碼如下:
Mail::to($emailAddress, $name)->send($email);
其他電子郵件格式,通過Laravel驗證工作就好了。
我不能重現此問題在本地
我使用laravel 5.3
地方: 的Windows 10 +宅基地+ mailtrap
生產: AWS +鍛造+ mailgun
Swiftmailer版本是5.4.8(從composer.lock檢索)
我可以使用Firefox V:54.0(32位)在本地重現它。這看起來很奇怪,我無法在本地使用Chrome在生產中重現它。 以下是完整的例外:
Swift_RfcComplianceException in MailboxHeader.php line 345: Address in mailbox given [[email protected]] does not comply with RFC 2822, 3.6.2.
in MailboxHeader.php line 345
at Swift_Mime_Headers_MailboxHeader->_assertValidAddress('[email protected]') in MailboxHeader.php line 261
at Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(array('[email protected]' => null)) in MailboxHeader.php line 106
at Swift_Mime_Headers_MailboxHeader->setNameAddresses(array('[email protected]' => null)) in MailboxHeader.php line 63
at Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(array('[email protected]' => null)) in SimpleHeaderFactory.php line 58
at Swift_Mime_SimpleHeaderFactory->createMailboxHeader('To', array('[email protected]' => null)) in SimpleHeaderSet.php line 68
at Swift_Mime_SimpleHeaderSet->addMailboxHeader('To', array('[email protected]' => null)) in SimpleMessage.php line 329
at Swift_Mime_SimpleMessage->setTo(array('[email protected]' => null)) in SimpleMessage.php line 305
at Swift_Mime_SimpleMessage->addTo('[email protected]', null) in Message.php line 151
at Message->addAddresses('[email protected]', null, 'To') in Message.php line 85
at Message->to('[email protected]', null) in Mailable.php line 226
at Mailable->buildRecipients(object(Message)) in Mailable.php line 113
at Mailable->Illuminate\Mail\{closure}(object(Message))
at call_user_func(object(Closure), object(Message)) in Mailer.php line 413
at Mailer->callMessageBuilder(object(Closure), object(Message)) in Mailer.php line 207
at Mailer->send('email.user_verification_change_email', array('user' => object(User), 'connection' => null, 'queue' => null, 'delay' => null, 'message' => object(Message)), object(Closure)) in Mailable.php line 117
at Mailable->send(object(Mailer)) in Mailer.php line 192
at Mailer->send(object(UserConfirmationChangeEmail)) in MailableMailer.php line 99
at MailableMailer->send(object(UserConfirmationChangeEmail)) in SendConformationEmailChangedEmail.php line 35
at SendConformationEmailChangedEmail->handle(object(UserEmailChanged))
at call_user_func_array(array(object(SendConformationEmailChangedEmail), 'handle'), array(object(UserEmailChanged))) in Dispatcher.php line 354
at Dispatcher->Illuminate\Events\{closure}(object(UserEmailChanged))
at call_user_func_array(object(Closure), array(object(UserEmailChanged))) in Dispatcher.php line 221
at Dispatcher->fire('App\Events\Users\UserEmailChanged') in helpers.php line 480
at event(object(UserEmailChanged)) in InstructorControllerAdmin.php line 198
at InstructorControllerAdmin->update(object(Request), object(User))
at call_user_func_array(array(object(InstructorControllerAdmin), 'update'), array(object(Request), 'users_admin' => object(User))) in Controller.php line 55
at Controller->callAction('update', array(object(Request), 'users_admin' => object(User))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(InstructorControllerAdmin), 'update') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 653
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 29
at Authenticate->handle(object(Request), object(Closure), 'admins') in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 655
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in RedirectsMissingPages.php line 13
at RedirectsMissingPages->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 53
https://laracasts.com/discuss/channels/general-discussion/help-with-welcome-email-via-mailgun?page=0? – Spikolynn
我在調查中遇到了上面的鏈接,但這不是我的情況。它適用於其他有效的電子郵件格式,即使Chrome上的格式相同,這個問題只會發生在Firefox上。 – Mehdi