Laravel Gmail not working, quot;Username and Password not accepted. Learn more...quot;(Laravel Gmail 不工作,“用户名和密码不被接受.了解更多...)
问题描述
当我尝试通过运行 Laravel 4 的网站发送电子邮件时,我收到以下异常:
When I try to send an e-mail through my website running Laravel 4, I get this exception:
{"error":{"type":"Swift_TransportException","message":"Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 y70sm14744455qgd.3 - gsmtp
"","file":"/var/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","line":386}}
这是我的邮件配置:
return array(
'driver' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 465,
'from' => array('address' => 'mymail@gmail.com', 'name' => 'myname'),
'encryption' => 'ssl',
'username' => 'mymail@gmail.com',
'password' => 'lol',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
);
我已经尝试了通过谷歌搜索这个问题找到的禁用链接,但它没有任何区别.
I've tried the disable link i've found by googling this issue except it didn't make a difference.
有没有办法告诉谷歌停止屏蔽这个 IP,是我"?
Is there a way to tell Google "stop blocking this IP, it's me" ?
推荐答案
我尝试了同样的事情,得到了同样的错误.所以我亲自检查了我的 gmail 帐户,我收到了来自 Gmail 本身的消息,让我知道他们阻止了对我的电子邮件帐户的访问尝试.
I tried the same thing and got the same error. So i personally checked my gmail account and i had a message from Gmail itself letting me know that they'd blocked an access attempt to my email account.
他们通过访问 https 显示了禁用此安全设置的选项://www.google.com/settings/security/lesssecureapps.
如果您访问已经登录到您的 Gmail 帐户的链接,事情实际上会更直接.
Things will actually be more straight forward if you visit that link already logged in into your Gmail account.
这篇关于Laravel Gmail 不工作,“用户名和密码不被接受.了解更多..."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Laravel Gmail 不工作,“用户名和密码不被接受.了解更多..."
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- Laravel 仓库 2022-01-01