3

Laravel does not return any useful information to show the reason that email fails. The SwifMailer Logger plugins helps with debugging during the process of sending. What is the correct way to set this plugin (and other swifmailer plugins) when emails are sent through Laravel's Mail class?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173
  • The same question is over here, and I just answered it: https://stackoverflow.com/a/53783301/470749 – Ryan Dec 14 '18 at 16:14

1 Answers1

3

Use

Mail::getSwiftMailer()->registerPlugin();

You can place this code into some service provider for example to be executed on application startup. Or you can override Illuminate\Mail\Mailer entirely if you want.

Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156