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

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)