Laravel SwiftMailer:预期响应代码为 250,但得到代码“530",消息为“530-5.5.

Laravel SwiftMailer : Expected response code 250 but got code quot;530quot;, with message quot;530-5.5.1 Authentication Required(Laravel SwiftMailer:预期响应代码为 250,但得到代码“530,消息为“530-5.5.1 需要身份验证) - IT屋-程序员软件开发
本文介绍了Laravel SwiftMailer:预期响应代码为 250,但得到代码“530",消息为“530-5.5.1 需要身份验证"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在使用 laravel 5.2,并且使用 Swift Mailer 进行密码重置.我的 Gmail 有两步验证..

I am using laravel 5.2, And the using Swift Mailer for password resetting. I have 2-step verification on my gmail..

正如谷歌帮助所说:

如果您为自己的帐户启用了两步验证,则可能需要输入应用密码而不是常规密码.

If you've turned on 2-Step Verification for your account, you might need to enter an App password instead of your regular password.

我在 mail.php 上有以下设置:

I have the following settings on mail.php :

return [
    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.gmail.com'),
    'port' => env('MAIL_PORT', 465),
    'from' => ['address' => 'meaprogrammer@gmail.com', 'name' => 'Shafee'],
    'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
    'username' => env('meaprogrammer@gmail.com'),
    'password' => env('MY_Gmail_API_KEY'),
    'sendmail' => '/usr/sbin/sendmail -bs',
    'pretend' => env('MAIL_PRETEND', false),

];

.env 我有:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=meaprogrammer@gmail.com
MAIL_PASSWORD=MY_Gmail_API_KEY
MAIL_ENCRYPTION=ssl

出现以下错误:

Swift_TransportException in AbstractSmtpTransport.php line 383:

Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. 

Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 w10sm15831823wjk.18 - gsmtp
"

推荐答案

尝试在 此页面.阅读这个谷歌答案.

这篇关于Laravel SwiftMailer:预期响应代码为 250,但得到代码“530",消息为“530-5.5.1 需要身份验证"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

In PHP how can you clear a WSDL cache?(在 PHP 中如何清除 WSDL 缓存?)
failed to open stream: HTTP wrapper does not support writeable connections(无法打开流:HTTP 包装器不支持可写连接)
Stop caching for PHP 5.5.3 in MAMP(在 MAMP 中停止缓存 PHP 5.5.3)
Caching HTTP responses when they are dynamically created by PHP(缓存由 PHP 动态创建的 HTTP 响应)
Memcached vs APC which one should I choose?(Memcached 与 APC 我应该选择哪一个?)
What is causing quot;Unable to allocate memory for poolquot; in PHP?(是什么导致“无法为池分配内存?在 PHP 中?)