config / mail.php
return [
'driver' => env('MAIL_DRIVER'),
'host' => env('MAIL_HOST'),
'port' => env('MAIL_PORT'),
'from' => [
'address' => env('MAIL_FROM_ADDRESS'),
'name' => env('MAIL_FROM_NAME'),
],
'encryption' => env('MAIL_ENCRYPTION'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=j*********
MAIL_PASSWORD=***********
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=j*******[email protected]
MAIL_FROM_NAME=*************
controller
Mail::send('emails.confirma',$rq,function($message) use($rq){
$message->subject('Confirmacion de Registro');
$message->to($rq['email']);
});
throws me this evil error ::
(1/1) Swift_TransportException
Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required