Laravel Gmail无法使用,“用户名和密码未被接受。了解更多...“ [英] Laravel Gmail not working, "Username and Password not accepted. Learn more..."

查看:146
本文介绍了Laravel Gmail无法使用,“用户名和密码未被接受。了解更多...“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过运行Laravel 4的网站发送电子邮件时,出现以下异常:

  {错误:{type:Swift_TransportException,message:预期的响应代码250但获得代码\535 \,并且消息\535-5.7.8用户名和密码不被接受。了解更多信息,请访问:http:\ / \ / support.google.com \ / mail\ / bin\ / answer.py?answer = 14257 y70sm14744455qgd.3  -  gsmtp\ r\\\
\ , 文件:\ / var\ / www\ / vendor\ / swiftmailer\ / swiftmailer\ / lib\ / classes\ / Swift\ /交通运输\ / AbstractSmtpTransport.php,line:386}}

这是我的邮件配置:

 返回数组(
'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,
);

我尝试了使用Google搜索这个问题找到的禁用链接,

有没有告诉Google停止阻止这个IP,这是我的方法?

解决方案

我尝试了同样的事情,并得到相同的错误。所以我亲自检查了我的gmail帐户,并且我收到了Gmail自己发出的一条消息,告诉我他们已经阻止了对我的电子邮件帐户的访问。



他们展示了一个选项通过访问 https://www.google.com来停用此安全设置/ settings / security / lesssecureapps


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\r\n535 5.7.8 http:\/\/support.google.com\/mail\/bin\/answer.py?answer=14257 y70sm14744455qgd.3 - gsmtp\r\n\"","file":"\/var\/www\/vendor\/swiftmailer\/swiftmailer\/lib\/classes\/Swift\/Transport\/AbstractSmtpTransport.php","line":386}}

Here is my mail config:

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.

Is there a way to tell Google "stop blocking this IP, it's me" ?

解决方案

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.

They showed an option to disable this security setting by visiting https://www.google.com/settings/security/lesssecureapps.

这篇关于Laravel Gmail无法使用,“用户名和密码未被接受。了解更多...“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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