.envMAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=MyLogo@gmail.com
MAIL_PASSWORD=MyPass
MAIL_ENCRYPTION=tls
mail.phpreturn [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [address' => 'example@gmail.com', 'name' => 'example',],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => ['theme' => 'default', 'paths' => [resource_path('views/vendor/mail'),],],
'pretend' => false,
web.phpRoute::get('emailtest', function(){
Mail::send('emails.mail', [], function ($message)
{
$message->to('sonterix@gmail.com', 'HisName')->subject('Welcome!');
$message->from('test@gmail.com','Test Tester');
});
});
Я думал, что всё верно и 100 раз перепроверил, но всегда результат " Swift_TransportException
Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required".
В чём моя ошибка? Буду рад любой помощи!