Laravel Mail to Log Laravel Mail to Log laravel laravel

Laravel Mail to Log


This is in your mail.php config file...

When using

'driver' => env('MAIL_DRIVER', 'log'),

This will get the MAIL_DRIVER environment variable set in your .env file. In this case, 'log' is used only as a default if a value is not specified in your .env file... Your .env file probably has this still set in it... set it to log...

MAIL_DRIVER=smtp

replace with

MAIL_DRIVER=log

NOTE: For laravel >= 7.x MAIL_DRIVER replaced with MAIL_MAILER variable


Laravel use .ENV file!

Maybe your edit config\mail.php, try to make edits in the ENV file

Make dump the variable with your current mail configuration

Put this code in your controller

dd(config('mail'));

You will see the current settings that the system uses.


One more reason why your MAIL_DRIVER=log configuration may not be working as expected is that you have your QUEUE_DRIVER set to something other than sync.

Thanks to the tip by gibex on Laracasts.