密码重置电子邮件获取530

密码重置电子邮件获取530

本文介绍了密码重置电子邮件获取530 5.7.1需要身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试发送密码重置电子邮件时,出现以下错误:

When I try to send a password reset email, I get the following error:

Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required"

我不确定这是怎么回事.我查看了Stack Overflow和Laracasts,发现了类似的问题.我尝试了两个不同的电子邮件地址和服务器.但是我遇到了同样的错误.

I'm not sure what's wrong here. I've looked at Stack Overflow and Laracasts and found similar problems. I've tried two different email addresses and servers. But I'm getting the same error.

这是我的.env文件:

Here's my .env file:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=[password]
MAIL_ENCRYPTION=tls

这是我的mail.php文件:

Here is my mail.php file:

'driver' => env('MAIL_DRIVER'),
'host' => env('MAIL_HOST'),
'port' => env('MAIL_PORT'),
'from' => [
   'address' => '[email protected]',
   'name' => 'XX',
],
'encryption' => env('MAIL_ENCRYPTION'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',

有什么想法我在这里错了吗?

Any ideas what I've got wrong here?

推荐答案

我发现更改.env文件要求您清除配置缓存:

I found that changing the .env file requires you to clear you config cache:

php artisan config:cache

此方法有效,现在正在发送电子邮件.

This worked and now email is sending.

这篇关于密码重置电子邮件获取530 5.7.1需要身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 01:41