Testcontainers
Spin up real databases and services in Docker from inside your tests.
A local SMTP server and web inbox for testing the emails your app sends.
No votes yet. Tried it? Be the first to say.
One vote per person. No account needed.
Point your app's SMTP settings at Mailpit and every email lands in a web UI instead of a real inbox. It has an API for asserting on emails in automated tests.
MailHog (unmaintained), sending test emails to your own address
Your app sends sign-up, reset or notification emails.
Accepts every email your app sends and never delivers it anywhere.
Browse messages with HTML, plain-text, source and header views, plus attachments.
Flags HTML and CSS features that popular email clients don't support.
Tests links in your emails, and can score messages with SpamAssassin.
List, search, read and delete messages from automated tests.
A single binary or a small Docker image, with optional SQLite persistence.
In docker compose, next to your app:
services:
mailpit:
image: axllent/mailpit
ports:
- "8025:8025" # web UI and API
- "1025:1025" # SMTPPoint your app's SMTP settings at host mailpit (or localhost) on port 1025, with no TLS and no authentication. Open http://localhost:8025 to see what was sent.
// after triggering a password reset in an end-to-end test
const res = await fetch('http://localhost:8025/api/v1/messages');
const { messages } = await res.json();
const reset = messages.find((m) => m.Subject.includes('Reset your password'));
expect(reset).toBeDefined();The API also offers search and full message retrieval (HTML, text and headers), so you can extract and follow the reset link in a browser test.
MP_MAX_MESSAGES to change how many messages are kept, and MP_DATABASE to persist them to a file.docker run -d -p 8025:8025 -p 1025:1025 axllent/mailpit
# SMTP on localhost:1025, inbox at http://localhost:8025 The previous go-to tool, now unmaintained.
A Ruby-based catcher with a simple UI.
A .NET-based equivalent with a web UI.
A hosted email sandbox with team features.
Other tools that share topics with Mailpit.
Spin up real databases and services in Docker from inside your tests.
A small, fast container runtime for macOS, Windows and Linux that replaces Docker Desktop.
An offline API client that stores collections as plain text files in your repo.