Start free trial
Start free trial Log in

14-day free trial. No credit card.

How to Monitor Laravel Mail in Production

Send latency, failed sends, and how to tell "Laravel didn't send it" from "the provider bounced it."

  • Guide
  • 3 min read

How do I monitor Laravel email sending in production?

Monitor three layers: your mail provider's dashboard for delivery / bounce / spam status, Laravel's MessageSending and MessageSent events to log every send, and an APM mail watcher that ties sends to the request or job that triggered them with per-class duration. Laravel has no mail failure event: a failed send throws, so it surfaces as an exception or a failed queued job.

Updated

Email is the feature you find out is broken from your users, not your dashboard. Laravel hands the message to a queue, the queue hands it to a provider, the provider hands it to an inbox, and any of those handoffs can fail quietly. "Laravel didn't send it" and "the provider bounced it" look identical from the outside (no email arrived) but have completely different fixes, and you can't tell them apart without watching both the send side and the delivery side. Monitoring mail is mostly about closing that gap.

Always queue mail in production

A synchronous send blocks the request while Laravel talks to your mail provider, which can take a second or more. Queue it.

php
// Bad: blocks the signup request
Mail::to($user)->send(new WelcomeMail($user));

// Good: dispatches to a queue worker
Mail::to($user)->queue(new WelcomeMail($user));

// Delayed: sends two minutes later
Mail::to($user)->later(now()->addMinutes(2), new WelcomeMail($user));

If your mail worker isn't running, queued mail silently piles up. See our queue monitoring guide.

Log every send

Laravel fires two mail events: MessageSending before the message goes to the transport and MessageSent after the transport accepts it. There is no failure event. A send that fails throws, so it surfaces as an exception, or as a failed SendQueuedMailable job when the mail was queued.

app/Providers/AppServiceProvider.phpphp
use Illuminate\Mail\Events\MessageSent;
use Illuminate\Support\Facades\Event;

public function boot(): void
{
    Event::listen(MessageSent::class, function (MessageSent $event) {
        \DB::table('mail_log')->insert([
            'subject' => $event->message->getSubject(),
            'to' => collect($event->message->getTo())->map->getAddress()->implode(', '),
            'mailer' => $event->data['mailer'] ?? 'default',
            'sent_at' => now(),
        ]);
    });
}

Mail provider webhooks fill in what happens after the send: delivered, bounced, complained, opened. Register a webhook endpoint with your provider and log those too.

Track three metrics

Send rate

Mails sent per minute by class. A sudden drop usually means the queue worker died or SMTP credentials expired.

Send duration

p95 time from MessageSending to MessageSent, the transport call itself. Spikes usually mean provider rate limits or network issues.

Delivery rate

Delivered / attempted from provider webhooks. A drop usually means IP reputation issues or bad recipient lists.

Where it actually breaks

Because email crosses three systems, the useful skill is knowing which one swallowed the message, and the split is clean once you instrument both sides.

If Laravel's MessageSent event never fired, the failure is yours: a dead queue worker, a Mailable that threw while rendering its Blade view, or MAIL_MAILER=log quietly left on in production. The fix is in your code or your workers.

If MessageSent fired but the provider's webhook reports a bounce, a complaint, or no delivery, the failure is downstream: a bad recipient address, IP reputation, a spam filter. The fix is list hygiene or provider configuration, not your application.

Watch only one side and you're guessing. The send-side events tell you the app did its job; the provider webhooks tell you whether the message actually landed. You need both to answer the question every "my email didn't arrive" ticket is really asking: whose problem is it?

What to alert on

  • Send rate drops to 0 for >5 minutes: worker down or credentials bad
  • Spike in failed mail jobs: 20+ failed queued sends of the same Mailable class in 10 min
  • Bounce rate > 2%: list hygiene problem, risking IP reputation
  • Complaint rate > 0.1%: users marking as spam, provider will soon throttle you

These are counts and rates, which NightOwl doesn't alert on, so set them up in your mail provider's dashboard or as a scheduled check on your own send records.

Route mail alerts to Slack or Discord, never email. If mail is broken, email alerts are exactly what you can't receive.

See which Mailables slow down your sends

Send latency is the metric you can act on first, and NightOwl records it for every send with its Mailable class, subject and mailer. Each class shows average and p95 send duration, and each send is tied to the request or queued job that triggered it. Mail sent by a notification shows up on the Notifications page.

No credit card needed.

Terminal
composer require nightowl/agent
php artisan nightowl:install
php artisan nightowl:agent

Frequently asked questions

Anything else, write to support@usenightowl.com

How do I know if my Laravel app is actually sending emails?

Three places to check: (1) your mail provider's dashboard (Postmark, SES, Mailgun, Resend) shows delivered/bounced/opened, (2) Laravel's MessageSending and MessageSent events in AppServiceProvider let you log every send, (3) an APM with a mail watcher records every send with its Mailable class, subject, mailer and duration, tying mail sends back to the request or job that triggered them.

Why did my Laravel email not arrive?

Five common causes: (1) the queued mail job failed silently (check failed_jobs), (2) the SMTP credentials are wrong or expired (check your provider dashboard), (3) the mail was sent but bounced or was spam-filtered (check provider delivery log), (4) MAIL_MAILER=log is set in production, (5) the Mailable's Blade view threw while rendering and your code caught and swallowed the exception.

Should I use Mail::queue or Mail::send?

Mail::queue in production, always. A synchronous send blocks the request while Laravel talks to the mail provider, which can take a second or more per email and is unacceptable on a signup or checkout. Queue dispatches to a background worker that doesn't delay the user's response. Workers attempt a job once by default, so set --tries (or $tries on the Mailable) if you want failed sends retried. The only reason to use synchronous send is in a CLI script where you can block.

How do I log all outbound Laravel email for audit?

Listen to the MessageSent event and persist to a table: message class, to/from/subject, sent_at, user_id. For compliance (HIPAA, financial) keep this in a separate table you control the retention of. Most mail providers also offer message archive. Use both: provider for delivery status, your own for audit.

Can I test Laravel emails without sending them?

In tests, use Mail::fake() to intercept sends and assert what would have gone out. In development, set MAIL_MAILER=log to write to storage/logs/laravel.log, or MAIL_MAILER=array to collect in memory. For a realistic preview, use a mail catcher such as Mailtrap or Mailpit, which captures every email and shows how it renders.

How do I monitor Laravel email latency and delivery rate?

Record a start time in a MessageSending listener, then compute the duration in a MessageSent listener and log it with class and mailer. Track delivery rate via your provider's webhook (bounces, spam complaints, delivered). An APM with a mail watcher (NightOwl, Nightwatch Cloud) ties sends to requests and shows average and p95 duration per Mailable class. A send that throws shows up as an exception on the request or job that ran it.

Should I alert on mail send failures?

Yes, with thresholds. A single failed send is noise (network blip, one bad address). A spike (20+ failures in 10 minutes of a specific Mailable class) is a real signal. Route alerts to Slack or Discord, not email, because a mail outage would swallow the alert too. NightOwl alerts when a send throws a new exception or runs past the duration threshold you set for its Mailable, so a count-per-window rule like this needs a listener or a scheduled check.

Flat pricing, whatever your traffic does

Every plan starts with a 14-day free trial. No credit card needed.

Hobby
$5 a month

One app for a side project. Issues and alerts, with a 14-day dashboard window.

Start my 14-day trial
TeamRecommended
$15 a month

Up to 3 apps and 5 people per team. Full history, the MCP server, data clearing and agent health.

Start my 14-day trial
Agency
$69 a month

Unlimited client apps and people, one overview of every app, and apps you can hand over.

Start my 14-day trial

Related

Time every mail send in your app

See average and p95 send duration per Mailable, tied to the request or job that sent it. No credit card needed.