Laravel Gmail 不工作,“用户名和密码不被接受.了解更多..." [英] Laravel Gmail not working, "Username and Password not accepted. Learn more..."

查看:20
本文介绍了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 不工作,“用户名和密码不被接受.了解更多..."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆