对于遵循以下格式的电子邮件地址,我收到了RFC 2822,3.6.2错误(仅限生产中):abc@xyz.co.uk
源代码如下:
Mail::to($emailAddress, $name)->send($email);
通过Laravel验证的其他电子邮件格式工作正常。
我无法在本地重现此问题
我正在使用laravel 5.3
本地: Windows 10 + homestead + mailtrap
生产: AWS + forge + mailgun
Swiftmailer版本是5.4.8(从composer.lock中检索)
我可以使用Firefox V:54.0(32位)在本地重现它。这看起来很奇怪,我无法在本地使用Chrome重现它。 以下是完整的例外:
Swift_RfcComplianceException in MailboxHeader.php line 345: Address in mailbox given [abc@xyz.co.uk] does not comply with RFC 2822, 3.6.2.
in MailboxHeader.php line 345
at Swift_Mime_Headers_MailboxHeader->_assertValidAddress('abc@xyz.co.uk') in MailboxHeader.php line 261
at Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(array('abc@xyz.co.uk' => null)) in MailboxHeader.php line 106
at Swift_Mime_Headers_MailboxHeader->setNameAddresses(array('abc@xyz.co.uk' => null)) in MailboxHeader.php line 63
at Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(array('abc@xyz.co.uk' => null)) in SimpleHeaderFactory.php line 58
at Swift_Mime_SimpleHeaderFactory->createMailboxHeader('To', array('abc@xyz.co.uk' => null)) in SimpleHeaderSet.php line 68
at Swift_Mime_SimpleHeaderSet->addMailboxHeader('To', array('abc@xyz.co.uk' => null)) in SimpleMessage.php line 329
at Swift_Mime_SimpleMessage->setTo(array('abc@xyz.co.uk' => null)) in SimpleMessage.php line 305
at Swift_Mime_SimpleMessage->addTo('abc@xyz.co.uk', null) in Message.php line 151
at Message->addAddresses('abc@xyz.co.uk', null, 'To') in Message.php line 85
at Message->to('abc@xyz.co.uk', 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
答案 0 :(得分:1)
确保
您是否检查过PHP错误日志?