Mailpit is a small, fast, low memory, zero-dependency, multi-platform email testing tool & API for developers.
It acts as an SMTP server, provides a modern web interface to view & test captured emails, and contains an API for automated integration testing.
Mailpit was originally inspired by MailHog which is now no longer maintained and hasn't seen active development for a few years now.
- Runs entirely from a single binary, no installation required
- SMTP server (default
0.0.0.0:1025
) - Web UI to view emails (formatted HTML, highlighted HTML source, text, headers, raw source and MIME attachments including image thumbnails)
- HTML check to test & score mail client compatibility with HTML emails
- Link check to test message links (HTML & text) & linked images
- Screenshots of HTML messages via web UI (see wiki)
- Mobile and tablet HTML preview toggle in desktop mode
- Light & dark web UI theme with auto-detect
- Advanced mail search (see wiki)
- Message tagging (see wiki)
- Real-time web UI updates using web sockets for new mail
- Optional browser notifications for new mail (when accessed via either HTTPS or
localhost
only) - Configurable automatic email pruning (default keeps the most recent 500 emails)
- Email storage either in a temporary or persistent database (see wiki)
- Fast SMTP processing & storing - approximately 70-100 emails per second depending on CPU, network speed & email size, easily handling tens of thousands of emails
- SMTP relaying / message release - relay messages via a different SMTP server including an optional allowlist of accepted recipients (see wiki)
- Optional SMTP with STARTTLS & SMTP authentication, including an "accept anything" mode (see wiki)
- Optional HTTPS for web UI (see wiki)
- Optional basic authentication for web UI (see wiki)
- A simple REST API (see docs)
- Multi-architecture Docker images
The Mailpit web UI listens by default on https://0.0.0.0:8025
, and the SMTP port on 0.0.0.0:1025
.
Mailpit runs as a single binary and can be installed in different ways:
Install Mailpit with brew install mailpit
.
To run automatically run mailpit in the background, run brew services start mailpit
.
Linux & Mac users can install it directly to /usr/local/bin/mailpit
with:
sudo bash < <(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh)
Static binaries can always be found on the releases. The mailpit
binary can extracted and copied to your $PATH
, or simply run as ./mailpit
.
See Docker instructions for 386, amd64 & arm64 images.
To build Mailpit from source see building from source.
Run mailpit -h
to see options. More information can be seen in the docs.
If installed using homebrew, you may run brew services start mailpit
to run always run mailpit automatically.
Please refer to the documentation of how to easily test email delivery to Mailpit.
Mailpit's SMTP server (by default on port 1025), so you will likely need to configure your sending application to deliver mail via that port. A common MTA (Mail Transfer Agent) that delivers system emails to a SMTP server is sendmail
, used by many applications including PHP. Mailpit can also act as substitute for sendmail. For instructions of how to set this up, please refer to the sendmail documentation.