Answer the question
In order to leave comments, you need to log in
How to fix Swift_TransportException error when sending email?
.env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=MyPass
MAIL_ENCRYPTION=tls
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [address' => '[email protected]', '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,
Route::get('emailtest', function(){
Mail::send('emails.mail', [], function ($message)
{
$message->to('[email protected]', 'HisName')->subject('Welcome!');
$message->from('[email protected]','Test Tester');
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question