Laravel Gmail无法正常工作,“用户名和密码不被接受。了解更多...”
当我尝试通过运行Laravel 4的网站发送电子邮件时,我得到这个异常:
{"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}}
这是我的邮件配置:
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,
);
我已经尝试了通过谷歌搜索此问题找到的禁用链接,但它没有区别。
有没有办法告诉谷歌“停止阻止这个IP,是我”?