JonYork
JonYork

Reputation: 1243

Laravel Mail not sending to Log

I am having some troubles with Laravel 5.8 and sending the Mail into the logs for testing purposes.

Regular log level INFO gets written to the daily log without any trouble.

What am I missing in my current config?

.ENV file has :

MAIL_DRIVER=log
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
LOG_CHANNEL=stack

Mail.php

'driver' => env('MAIL_DRIVER', 'smtp'), 'log_channel' => env('MAIL_LOG_CHANNEL'),

Logging.php

 'default' => env('LOG_CHANNEL', 'stack'),
'stack' => [
            'driver' => 'stack',
            'channels' => ['daily'],
        ],

Upvotes: 0

Views: 7448

Answers (3)

hanmari
hanmari

Reputation: 1484

If you are using Laravel version 7 or greater, the .env file variable has changed:

VERSIONS <=6: MAIL_DRIVER=log
VERSIONS >=7: MAIL_MAILER=log

Upvotes: 0

Michael Nguyen
Michael Nguyen

Reputation: 1752

I am using Laravel Telescope and it works great. It has a Mail page which shows you all rendered emails. No need to send mail to log to debug. Matt Stauffer has a detailed go through of Telescope

Upvotes: 0

Rashedul Islam Sagor
Rashedul Islam Sagor

Reputation: 2059

Laravel :

Basically if you change or add any config, you must need to run clear:config or config:cache like below:

Run php artisan config:cache on terminal of project directory.

Upvotes: 1

Related Questions