How can I see the result or errors from the Mail::send or queue methods in Laravel? I have used dd() on the method but I get either a 0 of which I am assuming is false to show the email failed to send. Is there any way to put it into a debug mode so I can see where the mailer is failing?
There are many mail drivers to use to send email, so many ways to debug. An approach would be to set:
'driver' => env('MAIL_DRIVER', 'log'),
in config/mail.php then quickly test if logging of mail works with:
Mail::raw('Text to e-mail', function($message)
{
  $message->from('[email protected]', 'Laravel');
  $message->to('[email protected]');
});
Then depending on 3rd party services and protocol, keep iterating. For instance to use SES, one would fill in these environment keys:
MAIL_DRIVER='ses'
SES_KEY='XXX'
SES_SECRET='YYY'
SES_REGION='ZZZ'
in .env and then in config/services.php:
'ses' => [
    'key' => env('SES_KEY'),
    'secret' => env('SES_SECRET'),
    'region' => env('SES_REGION'),
],
Use php artisan tinker and test with the Mail::raw code above. Also note that AWS requires its API to be connected by HTTPS or it will not send email.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With