MailDotNull

Test email without sending email.

MailDotNull is a local inbox for development and tests. It speaks SMTP and the send APIs of Resend, SendGrid, Mailgun, Postmark, Mailjet, Brevo and Amazon SES, so you change one base URL and every message your app sends lands on your machine instead of in someone's mailbox.

npx maildotnull

Then open localhost:8025. Or run it with Docker.

Your code

const resend = new Resend("re_anything", {
  baseUrl: "http://localhost:8025",
});

What your SDK gets back

200 OK
{ "id": "4ef3b7c2-9a1d-4c5e-8f20-6b8d1e0a7c31" }

Where the email goes

Welcome to Greenhouse, Mara resend hello@greenhouse.example to mara@studio.example
The MailDotNull inbox with test emails from Resend, SendGrid, Mailjet, Amazon SES, Brevo, Postmark, Mailgun and SMTP, showing an HTML email preview.

Works with the SDK you already use

Each endpoint answers in the provider's real format, with message IDs and status codes, so the official SDK treats the send as a success. Any API key is accepted.

Resend

Test Resend emails locally: pass baseUrl to the Resend client and resend.emails.send() returns a real-looking id while the email lands in your inbox.

POST /emails

SendGrid

A SendGrid sandbox you run yourself. Point @sendgrid/mail at it with setDefaultRequest; each personalization becomes its own message, answered with 202 and an X-Message-Id.

POST /v3/mail/send

Mailgun

Use mailgun.js with any domain and key. Form fields, attachments and custom headers are parsed, and the reply is the familiar Queued. Thank you.

POST /v3/{domain}/messages

Postmark

Set requestHost on the Postmark ServerClient. Single and batch sends both work and return a MessageID per message.

POST /email, /email/batch

Mailjet

The v3.1 Send API that node-mailjet calls, including several messages per request and per-recipient results.

POST /v3.1/send

Brevo

Transactional email through the Brevo SDK: set its base path and every send returns a messageId.

POST /v3/smtp/email

Amazon SES

Test SES without the SES sandbox or verified identities. SESv2Client with a local endpoint, for simple and raw MIME sends.

POST /v2/email/outbound-emails

SMTP

Nodemailer, Rails Action Mailer, Django, Laravel, Spring: any SMTP client works. Plain, STARTTLS and TLS ports, any login. A drop-in for Mailpit and MailHog.

ports 1025, 1587, 1465

Let your coding agent check the email

MailDotNull has a built-in MCP server. Claude Code, Cursor, VS Code and other agents can sign up a test user, wait for the confirmation email and use its link or code, without you copying anything out of an inbox.

  1. The agent triggers the emailFor example by running your sign-up or password-reset flow.
  2. It waits for the messagewait_for_message returns as soon as a matching email arrives, and ignores older ones.
  3. It reads the resultThe visible text, every link and the likely verification codes come back ready to use.
  • list_messages search and filter the inbox
  • get_message text, links, codes, recipients, headers
  • wait_for_message wait for the next matching email
  • get_attachment read an invoice, calendar invite or image
  • delete_messages clean up the agent's own test mail

Connect your agent

claude mcp add --transport http maildotnull http://localhost:8025/mcp

What the agent gets back from wait_for_message

{
  "subject": "Your Tidepool sign-in code: 482913",
  "from": "Tidepool <no-reply@tidepool.example>",
  "to": ["jonas@field.example"],
  "text": "Your sign-in code is 482913. It expires in 10 minutes.",
  "codes": ["482913"],
  "links": [],
  "attachments": []
}

More than a mail catcher

Everything you need to check an email before a real person sees it.

A live inbox
Messages appear the moment they're sent. Read the HTML, plain text, headers, raw payload and attachments, or open one full screen.
Every screen, light and dark
Preview at desktop, tablet and phone widths, and see how Gmail, Apple Mail, Outlook.com and Yahoo render your email in dark mode.
HTML and link checks
Find CSS that breaks in common mail clients, and check every link's HTTP status with one click.
Failures on demand
Make any provider return rate limits, server errors, delays or timeouts in its real error format, and see how your app copes.
Start it from your tests
import { start } from "maildotnull" boots a server in your test setup and stops it afterwards. TypeScript types included.
Made for CI
Run the Docker image or npx maildotnull in your pipeline and assert on caught mail through the inbox API.
Nothing leaves your machine
Messages live in memory and are never delivered. A restart clears the inbox.
Free and open source
MIT licensed. One small binary for Linux, macOS and Windows, on x64 and arm64.

Install

Pick whatever fits your setup. All three start the same server.

npx

Needs Node.js 18 or later. Downloads one prebuilt binary for your platform.

npx maildotnull

Docker

Images for amd64 and arm64.

docker run -p 8025:8025 \
  -p 1025:1025 -p 1587:1587 \
  -p 1465:1465 \
  maildotnull/maildotnull

From source

Needs Node.js, pnpm and Go.

git clone https://github.com/maildotnull/maildotnull
cd maildotnull
pnpm install && pnpm dev

The inbox, provider APIs and MCP server run on port 8025, SMTP on 1025 (plain), 1587 (STARTTLS) and 1465 (TLS). Every port can be changed; see the configuration options.

Questions

How do I test Resend emails locally without sending them?

Run npx maildotnull and create the Resend client with baseUrl: "http://localhost:8025". resend.emails.send() returns a normal response with an id, and the email shows up in the inbox at localhost:8025 instead of being delivered. The same works for SendGrid, Mailgun, Postmark, Mailjet, Brevo and Amazon SES.

Is MailDotNull an alternative to Mailpit or MailHog?

Yes. It catches SMTP mail like Mailpit and MailHog, on the same default ports 1025 and 8025. It also mocks the HTTP send APIs of the big email providers, so apps that use an SDK instead of SMTP can be tested the same way.

Does MailDotNull ever send real email?

No. Every message stays in memory on your machine and is never delivered. Restarting MailDotNull clears the inbox.

Can I use it in CI and end-to-end tests?

Yes. Run the Docker image or npx maildotnull in your pipeline, or start it from your test setup with import { start } from "maildotnull". Playwright and Cypress tests can read caught mail through the inbox API, and AI agents through the MCP server.

Which API key do I need?

Any. MailDotNull accepts every API key and every SMTP login, so placeholder values are fine in development and tests.

Is MailDotNull free?

Yes. It is open source under the MIT license and runs entirely on your machine.