Laravel SwiftMailer:预期响应代码为 250,但得到代码

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 需要身份验证)
本文介绍了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 需要身份验证"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

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

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)