1

How to specify sender for email reports which are sent by using emailOutputTo() method of Laravel Scheduler?

Currently from header is empty and I see in Gmail:

enter image description here

enter image description here


My code is:

$schedule->command('some:task')
    ->dailyAt('05:30')
    ->sendOutputTo(config('path.logs') . '/output.log')
    ->emailOutputTo('email@example.com');

I'm using built-in Laravel Mail provider with mailgun driver.

Limon Monte
  • 52,539
  • 45
  • 182
  • 213

1 Answers1

3

Set the desired "from" in /config/mail.php:

'from' => ['address' => 'john.smith@gmail.com', 'name' => 'John Smith'],
MrCode
  • 63,975
  • 10
  • 90
  • 112