Laravel Email Testing and Sending with Maileroo | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com) - [Home](https://www.msaied.com)
- [Projects](https://www.msaied.com/projects)
- [Articles](https://www.msaied.com/articles)
- [Certificates](https://www.msaied.com/certificates)
- [About](https://www.msaied.com#about)

           [  Contact](https://www.msaied.com#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com)
- [ProjectsCase studies](https://www.msaied.com/projects)
- [ArticlesEngineering notes](https://www.msaied.com/articles)
- [CertificatesCredentials](https://www.msaied.com/certificates)
- [AboutHow I work](https://www.msaied.com#about)
- [ContactGet in touch](https://www.msaied.com#contact)

  [Start a conversation](https://www.msaied.com#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com)
2. /
3. [Articles](https://www.msaied.com/articles)
4. /
5. [Laravel](https://www.msaied.com/articles?category=laravel)
6. /
7. Laravel Email Testing and Sending in One Account with Maileroo

   [Laravel](https://www.msaied.com/articles?category=laravel) [Tips &amp; Tricks](https://www.msaied.com/articles?category=tips-tricks) 

 Laravel Email Testing and Sending in One Account with Maileroo
===============================================================

 Maileroo combines a production SMTP relay with a built-in email testing sandbox. Catch every email your Laravel app sends, inspect spam scores, preview dark mode rendering, and assert on emails in CI — all from one account.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com#person) Published 2 Nov 2026 · Updated 4 Nov 2026 · 4 min read

ShareCopy linkCopied

 ![Laravel Email Testing and Sending in One Account with Maileroo](https://cdn.msaied.com/815/cd8ac8b9474dd51212681b4c6dd8a071.png) 

  On this page +1. [The Problem with Laravel Email Testing Today](#the-problem-with-laravel-email-testing-today)
2. [Two Sides of One Account](#two-sides-of-one-account)
3. [Pointing Laravel at the SMTP Sink](#pointing-laravel-at-the-smtp-sink)
4. [What Each Check Tells You](#what-each-check-tells-you)
5. [Two Real Problems Caught in a Typical Laravel App](#two-real-problems-caught-in-a-typical-laravel-app)
6. [1. A 1.2 MB Attachment](#1-a-12-mb-attachment)
7. [2. Buttons That Break in Dark Mode](#2-buttons-that-break-in-dark-mode)
8. [Automated Assertions in CI](#automated-assertions-in-ci)
9. [Key Takeaways](#key-takeaways)

 The Problem with Laravel Email Testing Today
--------------------------------------------

Most Laravel apps send email — confirmations, password resets, receipts, weekly digests — but developers rarely see those emails the way a real customer does. Locally, mail goes to a log file. Staging points at a separate testing tool. Production uses a sending provider that nobody checks until a customer complains.

[Maileroo](https://maileroo.com) solves this by combining email sending and email testing in a single account. The same dashboard where you send real mail also hosts a private sandbox that captures, inspects, and scores every email your app produces.

Two Sides of One Account
------------------------

**Sending** delivers mail to real recipients via Maileroo's SMTP Relay or Email API, signed from your verified domain.

**Email Testing** is a sandbox with two entry points:

- **SMTP sink** — a mail server that accepts everything Laravel sends and stores it. Nothing is delivered. Point your `.env` at it and no test email can reach a real customer.
- **Test inboxes** — real addresses like `jack@sandbox.maileroo.io` that receive mail from anywhere, including Maileroo's own relay, so you can inspect exactly what a production send produces.

Pointing Laravel at the SMTP Sink
---------------------------------

No code changes are needed. Add these values to `.env`:

```env
MAIL_MAILER=smtp
MAIL_HOST=smtp.sandbox.maileroo.io
MAIL_PORT=587
MAIL_USERNAME=your-credential-username
MAIL_PASSWORD=your-credential-password
MAIL_FROM_ADDRESS="hello@ledgerly.maileroo.app"
MAIL_FROM_NAME="Ledgerly"

```

Mailables, notifications, and queued mail all flow through the same mailer:

```php
Mail::to($user)->send(new InvoicePaid($invoice));

```

Every captured message appears in the **Messages** list within seconds, with authentication results, spam score, and size shown at a glance.

What Each Check Tells You
-------------------------

- **Preview** — renders HTML and plain-text versions at desktop and mobile widths, plus light and dark mode client previews. Gmail clips HTML over 102 KB; the panel flags that too.
- **Authentication** — shows SPF, DKIM, and DMARC results. Messages caught by the sink will show failures by design; send through the relay to a test inbox to see passing results.
- **Spam Score** — Rspamd applies hundreds of rules and returns a score. Above 15 the message would be rejected. Each matching rule is listed with an explanation.
- **Blocklists** — checks the sending IP and every linked domain against Spamhaus, Barracuda, SpamCop, and others.
- **AI Analysis** — on demand, scores the email 0–10 and flags signals like brand-domain mismatches or phishing-like patterns. Useful for password resets and payment requests.

Two Real Problems Caught in a Typical Laravel App
-------------------------------------------------

### 1. A 1.2 MB Attachment

A PDF receipt generated with `barryvdh/laravel-dompdf` embedded the full DejaVu Sans font, inflating the email to 1.2 MB. Switching to a standard PDF font fixed it:

```css
/* before */
body { font-family: DejaVu Sans, sans-serif; }

/* after */
body { font-family: Helvetica, Arial, sans-serif; }

```

The email dropped from 1.2 MB to about 27 KB.

### 2. Buttons That Break in Dark Mode

Laravel's default mail theme uses thick borders to simulate button padding. Dark-mode recoloring treats borders and backgrounds differently, causing the button label to appear in a black box. Publishing the mail views and replacing borders with padding fixes the rendering across all clients.

Automated Assertions in CI
--------------------------

The Email Testing API exposes two CI-focused endpoints:

- `POST /wait/messages` — waits up to 40 seconds for a matching email.
- `POST /messages/{id}/assertions` — runs named checks and returns pass/fail.

A Pest test sends the real mailable to the SMTP sink, waits for it, then asserts on subject, size, Gmail clipping, accessibility score, and link blocklist status:

```php
$report = MailerooTesting::assert($message['id'], [
    ['type' => 'subject_contains', 'value' => 'INV-2026-0142'],
    ['type' => 'size_lte', 'value' => 100_000],
    ['type' => 'gmail_clip_eq', 'value' => false],
    ['type' => 'accessibility_score_gte', 'value' => 90],
    ['type' => 'links_rbl_clean', 'value' => true],
]);

expect($report['pass'])->toBeTrue(json_encode($report['results']));

```

If the oversized font returns, the build fails immediately with a clear message showing expected vs. actual size.

Key Takeaways
-------------

- The SMTP sink prevents any test email from reaching a real customer, regardless of what address is in the `To` field.
- Sending through the relay to a test inbox shows real SPF, DKIM, and DMARC results — the same view a mailbox provider gets.
- Dark mode previews and size checks catch rendering and deliverability problems before customers see them.
- Tagged addresses (`+hardbounce`, `+complaint`) trigger real bounce and spam-complaint webhooks on demand, so webhook handlers can be tested like any other code.
- CI assertions replace `Mail::fake()` for tests that need to verify the actual rendered email, not just that a Mailable was dispatched.

The free plan includes 100 captured emails, 5 test inboxes, 3 SMTP credentials, and 25 AI Analysis runs per month.

---

*Source: [Email Sending and Testing for Laravel in One Account — Laravel News](https://laravel-news.com/maileroo-laravel-email-testing)*

- [Laravel](https://www.msaied.com/articles?search=Laravel)
- [Email Testing](https://www.msaied.com/articles?search=Email%20Testing)
- [Maileroo](https://www.msaied.com/articles?search=Maileroo)
- [SMTP](https://www.msaied.com/articles?search=SMTP)
- [CI](https://www.msaied.com/articles?search=CI)
- [Deliverability](https://www.msaied.com/articles?search=Deliverability)

 Frequently asked questions 
---------------------------

  Why do SPF, DKIM, and DMARC fail when using the Maileroo SMTP sink?The SMTP sink accepts mail directly from your local machine or CI server, which is not listed in your domain's SPF record and does not sign with a DKIM key. These failures are expected and by design. To see passing authentication results, send through Maileroo's SMTP Relay to a test inbox — the relay uses your domain's published DNS records to sign and deliver the message correctly.

   How can I test bounce and spam-complaint handling in Laravel without waiting for a real event?Maileroo test inboxes support tagged addresses. Sending to `jack+hardbounce@sandbox.maileroo.io` triggers a permanent 550 rejection, and `jack+complaint@sandbox.maileroo.io` accepts the email then files an ARF spam complaint. Both events fire Maileroo's sending webhooks, so your Laravel webhook handler receives a real payload you can test against on demand.

   Does using Maileroo for email testing require changes to Laravel Mailables or notifications?No. You only change the SMTP settings in `.env`. Mailables, notifications, and queued mail all use the same mailer, so switching between the SMTP sink for development and the relay for production is purely a configuration change.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articlePIE 1.5 Changes PHP Extension Installs in CI](https://www.msaied.com/articles/pie-15-changes-php-extension-installs-in-ci)  

   On this page
-------------

1. [The Problem with Laravel Email Testing Today](#the-problem-with-laravel-email-testing-today)
2. [Two Sides of One Account](#two-sides-of-one-account)
3. [Pointing Laravel at the SMTP Sink](#pointing-laravel-at-the-smtp-sink)
4. [What Each Check Tells You](#what-each-check-tells-you)
5. [Two Real Problems Caught in a Typical Laravel App](#two-real-problems-caught-in-a-typical-laravel-app)
6. [1. A 1.2 MB Attachment](#1-a-12-mb-attachment)
7. [2. Buttons That Break in Dark Mode](#2-buttons-that-break-in-dark-mode)
8. [Automated Assertions in CI](#automated-assertions-in-ci)
9. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/814/db8ca6495138bff986574ce8d55b775e.png) Laravel · 3 min read### PIE 1.5 Changes PHP Extension Installs in CI

2 Nov 2026 ](https://www.msaied.com/articles/pie-15-changes-php-extension-installs-in-ci) [ ![](https://cdn.msaied.com/812/aa4ad01a8367beed63fe5ee9c09ef940.png) Laravel · 4 min read### Pollora: Run WordPress Inside a Laravel Application

29 Oct 2026 ](https://www.msaied.com/articles/pollora-run-wordpress-inside-a-laravel-application) [ ![](https://cdn.msaied.com/813/d766b04c30625291c7a35c33d3b0285e.png) Laravel · 3 min read### What's New in Laravel 13.39: Scheduled Session GC, Fluent Array Rules, and More

27 Oct 2026 ](https://www.msaied.com/articles/whats-new-in-laravel-1339-scheduled-session-gc-fluent-array-rules-and-more) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com)
- [Articles](https://www.msaied.com/articles)
- [Certificates](https://www.msaied.com/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/sitemap.xml)
