laravel 5.4:预期的响应代码250,但代码为“530”,消息“530-5.5.1需要验证。了解更多信息

问题描述 投票:2回答:7

我在laravel 5.4中测试密码重置,我收到了这个错误:

    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/?p=WantAuthError j71sm516784wmd.12 - gsmtp
"

这是我的.env文件

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=ssl

和我的mail.php

'driver' => env('MAIL_DRIVER', 'smtp'),

'host' => env('MAIL_HOST', 'smtp.gmail.com'),

'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),

'name' => env('MAIL_FROM_NAME', 'from me'),

'encryption' => env('MAIL_ENCRYPTION', 'ssl'),

'username' => env('[email protected]'),

'password' => env('mypassword'),

我试图打开我的Gmail帐户的“不太安全的应用程序”。没有任何改变 如何解决此错误消息?请有人帮帮我!

laravel authentication laravel-5.4
7个回答
1
投票

我遇到了类似的问题,我做的是 转到谷歌设置,从qazxsw poi启用2步验证或关注qazxsw poi

打开2步验证后,here链接将出现在2步验证的正下方。哪个会带你到this链接

然后按照App Password创建您的应用密码

然后复制生成的应用程序密码并将其粘贴到this文件中,如下所示

process

另外一定要检查.envMAIL_DRIVER=sendmail [email protected] MAIL_FROM_NAME=DomainName MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=YOUR_GMAIL_CREATED_APP_PASSWORD MAIL_ENCRYPTION=tls smtp 还运行sendmail 希望这会有所帮助


1
投票
MAIL_DRIVER

1
投票

我想你可以试试这个:

php artisan config:cache

I also getting same issue but finally I reached by below credentials MAIL_DRIVER=sendmail MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=your-email MAIL_PASSWORD=your-password MAIL_ENCRYPTION=tls Also enable **Allow less secure apps** in your gmail account follow link: https://myaccount.google.com/u/3/security Thanks 文件中进行更改后,不要忘记运行 MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=mypassword MAIL_ENCRYPTION=tls

您需要为自己的Google帐户执行两步验证。

希望这对你有用!


1
投票

我通过改变解决了这个问题:

php artisan config:cache

.env

0
投票

在从安全性较低的设备启用日志记录后,请确保'username' => env('my-email'), 'password' => env('my-password'), 文件包含以下配置:

'username' => 'my-email',
'password' => 'my-password',

确保您的密码用双引号“”舍入。并确保您的mail.php文件包含如下配置:

.env

并且不要忘记关闭服务器并运行“php artisan config:clear”来清除配置缓存。


0
投票

没有一个建议是从上面所有工作我已经尝试了几乎所有这些。这是__ config曾经做过:(任何适当的解决方案/建议高度关注TIA


0
投票

还请在MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD="your_passwrod_here" MAIL_ENCRYPTION=tls 中更改这样的代码:

'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'your_email'),
    ],
    'encryption' => env('MAIL_ENCRYPTION', 'tls'),
© www.soinside.com 2019 - 2024. All rights reserved.