嗨在我的laravel應用程序即時通訊發送郵件,當我創建一個新的用戶!所以在本地主機我用gmail的smtp與我的Gmail帳戶,用戶名和它的工作,但在服務器上我得到這個錯誤laravel發送郵件服務器與Gmail不工作
Swift_TransportException
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 pn5sm18998642wjc.4 - gsmtp "
這裏是我的代碼
if ($user->save())
{
View::composer('emails.auth.userMail', function($view)
{
$mail = Input::get('email');
$pass = Input::get('password');
$view->with('username' , $mail)->with('password' , $pass);
});
Mail::send('emails.auth.userMail', $data, function($message) use ($user)
{
$message->to(Input::get('email'), '')
->subject('Nouveau compte Happy Road ');
});
在mail.php
'driver' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 465,
'from' => array('address' => [email protected]', 'name' => 'name'),
'encryption' => 'ssl',
'username' => '[email protected]',
'password' => 'mypassword',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
什麼是您的電子郵件配置?在config/mail.php – justrohu 2014-09-10 15:45:54
通過爲應用程序生成一個新密碼來解決https://security.google.com/settings/security/apppasswords – 2014-09-10 17:00:50
添加這個答案,以便將來在這裏訪問的其他用戶可以快速找到解決方案。 – Vigs 2014-09-10 18:15:56