Development guide

MailHog, Mailpit and Papercut SMTP: how to test emails locally

Three test SMTP servers that catch your application's emails without sending them to anyone: what each one offers, how to install it, which ports it listens on and why MailHog is no longer the recommended choice.

An SMTP server that accepts everything and delivers nothing

When you build an application that sends emails (sign-ups, password resets, orders), you need to see what goes out without it reaching anyone. A test SMTP server accepts any message, stores it and shows it to you in an interface, but never delivers it to a recipient.

That way you check the subject, HTML, text, headers and attachments with your local environment's data, with no risk of emailing customers and without depending on a provider's connection or credentials.

Short answer

For a new project, use Mailpit: it runs on Windows, Linux, macOS and Docker, listens on port 1025 (SMTP) and 8025 (web) and is actively maintained. MailHog uses the same ports, but its latest release is from August 2020 and it's no longer maintained. Papercut SMTP is the alternative if you work on Windows and prefer a desktop app.

Comparison

The three tools at a glance

ToolHow to installDefault portsStatus
MailpitBinary for Windows, Linux and macOS, Homebrew or the axllent/mailpit Docker imageSMTP 1025 · web 8025Maintained: version 1.33.0, released October 31, 2026
MailHogBinary for Windows, Linux and macOS, Homebrew or the mailhog/mailhog Docker imageSMTP 1025 · web 8025Unmaintained: its latest release, 1.0.1, is from August 11, 2020
Papercut SMTPWindows installer (x64, x86 and ARM64), winget or the changemakerstudiosus/papercut-smtp Docker imageDesktop: SMTP 25 · Docker: SMTP 2525 and web 8080Maintained: version 7.8.0, released August 15, 2026

Versions and dates checked on November 2, 2026 on each project's official pages.

Mailpit

Mailpit: the usual MailHog replacement

Mailpit was inspired by MailHog and has become its usual replacement: it does the same job on the same default ports and keeps shipping new releases. It's a single binary under the MIT license.

Besides showing every email in the browser, it includes a REST API for automated tests, search and tags, an HTML compatibility check against email clients, a link and image checker and spam testing with SpamAssassin or Rspamd.

  1. 1Download the binary for your system from the official releases page, install it with brew install mailpit on macOS or start the Docker image.
  2. 2Run mailpit. By default it listens for SMTP on port 1025 and serves the web interface on 8025.
  3. 3Point your application at host localhost, port 1025, with no encryption or authentication.
  4. 4Open http://localhost:8025 and send a test email from your application.
docker run -d --restart unless-stopped --name=mailpit -p 8025:8025 -p 1025:1025 axllent/mailpit
MailHog

MailHog: why it's no longer a good place to start

For years MailHog was the go-to tool for catching emails in development, and many tutorials and older Docker setups still use it.

Its latest release, 1.0.1, came out on August 11, 2020. Mailpit's own README says MailHog is no longer maintained and has gone years without active development or security updates.

If you already use it, switching to Mailpit is simple: it listens on the same ports (1025 for SMTP and 8025 for the web), so your application doesn't need any changes; just swap the binary or the Docker image.

Papercut SMTP

Papercut SMTP: the desktop option for Windows

Papercut SMTP is a Windows desktop app that sits in the system tray and notifies you when an email arrives. It shows each message's HTML, text, headers, MIME parts, attachments and raw source.

It includes an optional background service with a web interface that receives email even when the app is closed, and a Docker image for containers and CI. The desktop app listens on 127.0.0.1, port 25, with no credentials; the Docker image uses port 2525 for SMTP and 8080 for the web.

winget install ChangemakerStudios.Papercut-SMTP

Papercut's documentation warns that the winget package may lag behind the latest release on GitHub.

Setup

How to point your application at the local SMTP

The setup is the same with all three tools: the host is localhost (or the service name if your application runs in Docker Compose), the port is the one the tool listens on and no encryption or username is needed. The sender can be any address.

# Symfony (.env.local)
MAILER_DSN=smtp://localhost:1025

# Laravel (.env)
MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025

# Node.js (Nodemailer)
nodemailer.createTransport({host: 'localhost', port: 1025, secure: false});

Keep this configuration in your local environment only. In staging and production, the same application should use a real SMTP server with its own credentials.

Production

From local testing to real sending

These tools don't deliver email, so they can't tell you whether your messages will reach the inbox. For that you need to send with your authenticated domain (SPF and DKIM) from a server with a good reputation and see the real status of every email.

The most practical approach is to keep the same configuration shape in every environment and change only the host, port and credentials: localhost:1025 in development and your provider's SMTP in staging and production.

  • Use different credentials in each environment and keep them out of the repository.
  • Verify your domain with the provider before the first real send.
  • Test the full flows (sign-up, password, order) in staging with your team's addresses.
  • Check in the provider's log that emails are delivered and how bounces are handled.
FAQ

Frequently asked questions

Does MailHog still work?

It still starts, but its latest release is from August 2020 and it gets no security updates. For a new project, Mailpit covers the same ground on the same default ports.

Mailpit or Papercut SMTP?

Mailpit runs on Windows, Linux, macOS and Docker, is used from the browser and has an API for automated tests. Papercut is handier if you work on Windows and want a desktop app that notifies you of every email.

Do these tools deliver the email to the recipient?

No. They catch and display it, but never deliver it. Mailpit and Papercut can be set up to relay to an external SMTP server, but by default no message leaves your machine.

Which port do I set in my application?

1025 with Mailpit or MailHog. With Papercut, 25 for the desktop app or 2525 if you use its Docker image. In every case, with no encryption or authentication.

Mailiqo

When you go to production

Mailiqo sends your application's emails with your authenticated domain, over SMTP or API, and logs the status of every email in the dashboard. Start free, no card required.

Create a free account
Mailiqo Labs

Put the guide into practice

The tools let you check SPF, DMARC, headers, bounces and HTML with your own data, without registering.