MailHog is one of the fastest ways to test outbound email from a local app.
It runs a fake SMTP server, captures messages, and gives you a web UI plus HTTP API to inspect what your app sent.
Quick answer: when MailHog is the right tool
Use MailHog when you need:
- local SMTP capture during feature development
- safe testing without sending to real customers
- quick checks of headers, HTML, and attachments
Do not use MailHog alone when you need:
- shared team visibility across environments
- robust CI assertions for signup/reset flows
- deliverability confidence at real mailbox providers
MailHog in 60 seconds
MailHog listens on SMTP (default ) and stores intercepted messages.
You inspect mail in:
- Web UI (default
) - HTTP API for automated assertions
This is why developers search for terms like "MailHog Docker", "MailHog SMTP server", and "MailHog mhsendmail".
Docker setup (recommended)
Run:
Then configure your app to use:
- SMTP host:
- SMTP port:
- auth: disabled (for local testing)
Open MailHog UI at .
Testing sendmail apps with mhsendmail
is useful when your app expects a local sendmail binary.
It forwards messages to MailHog's SMTP endpoint so local mail never escapes to real recipients.
Example:
What to validate in MailHog
Treat MailHog as a message quality gate for local work:
- Subject, from, and reply-to values are correct.
- Dynamic tokens render correctly in HTML and text parts.
- Attachments and MIME boundaries are valid.
- Links point to expected host/environment.
MailHog limitations teams hit later
| Limitation | Why it matters |
|---|---|
| Local process dependency | CI can become flaky if container lifecycle is not controlled |
| Shared-state friction | Hard to coordinate test visibility across multiple engineers |
| No real inbox/provider path | Cannot validate filtering, throttling, or mailbox placement |
MailHog vs hosted email testing
MailHog is excellent for local speed.
For release confidence, pair it with:
- Email Sandbox for disposable inbox workflows
- Email Integration Testing for app-level end-to-end checks
- Email Webhooks for event-driven assertions
- Email Deliverability Test for sender-quality monitoring
CI handoff pattern that works
Use a staged workflow:
- Local: MailHog for fast iteration.
- PR/CI: API-driven integration tests against disposable inboxes.
- Pre-release: deliverability and sender policy verification.
This keeps developer feedback fast without shipping blind.
FAQ
Is MailHog still useful in 2026?
Yes, for local debugging and template checks.
Can MailHog replace integration testing?
No. It captures local SMTP traffic but does not prove real receive-side behavior in production-like environments.
Is MailHog a Mailinator replacement?
Not directly. MailHog is local fake SMTP capture, while Mailinator-style tools focus on disposable inbox access.

