Skip to content

Email sandbox

Test your emails without emailing anyone.

Point your app, your tests or your staging server at a sandbox inbox. Every message is caught for you to preview, read and check, over the API or SMTP. Nothing is delivered, and there is no domain to set up.

Included on every plan, free included. Never counted as sent email.

How it works

  1. 1Create an inboxOne per app or environment. It comes with a key that starts ms_test_, safe to put in staging and CI.
  2. 2Swap the keyUse it where your live key goes. Same API, same SMTP server, no domain to verify and no other change.
  3. 3Look at what it sentEach message appears within seconds, rendered and checked. Nothing is delivered, so nobody is emailed by accident.
send.ts
import { MailClient } from "mailtruss";
​
const mail = new MailClient({ apiKey: process.env.MAILTRUSS_API_KEY! }); // ms_test_…
​
await mail.emails.send({
from: "Acme <hello@acme.example>", // any address: no domain needed here
to: "ana@example.com",
subject: "Welcome to Acme",
html: "<p>Hi Ana, thanks for signing up.</p>",
});

What you get

  • Preview like a recipient

    Desktop, tablet and mobile widths, light and dark, with images embedded in the message shown. Scripts and forms are switched off.

  • Read every byte

    The HTML and text parts, the raw RFC 822 source, every header with the Message-ID, and each attachment. Download the .eml.

  • Know what will break

    The same checker as the free Will it land? tool runs on every message: layout Outlook ignores, the Gmail 102 KB clip, links that will not work, spam-filter signals.

  • API and SMTP

    Send over the API or point WordPress, Laravel, Rails or Django at the SMTP server. Then read the inbox from your tests and assert on it.

  • Cannot reach a real person

    A sandbox key delivers nothing, to anyone, ever. Use real people's addresses in test data without a second thought.

  • Safe to share

    A sandbox key can only fill and read its own inbox. It cannot touch your domains, suppression list, webhooks or live keys, and it never counts as sent email.

Limits by plan

The sandbox is part of every plan. These limits are for the sandbox only and are separate from the emails you send.

PlanInboxesMessages a dayKept per inboxKept for
Free11001003 days
Starter31,00050014 days
Pro105,0001,00030 days
Business5020,0002,00090 days

Common questions

Is the sandbox free?
Yes. Every plan includes it, the Free plan too: 1 inbox, up to 100 messages a day, kept 3 days. Paid plans raise those limits. Sandbox messages are never counted as sent email.
Does anything get delivered?
No. A message sent with a sandbox key is validated like any other send (addresses, body, headers, template, attachments) and then kept in the inbox. It is never handed to a delivery network, so it cannot reach a real mailbox.
Do I need to verify a domain?
No. Use any From address. That is the point: you can test before your domain is set up, and in environments that will never have one.
How is this different from sending to a test address?
Test addresses such as delivered@mailtruss.test run a real send through the delivery pipeline to see the events and webhooks, and show you nothing of the message. The sandbox keeps the message itself so you can look at it, and runs no real delivery.
Can my automated tests read the inbox?
Yes. A sandbox key can list, read and delete the messages in its inbox through the API, so a test can send, then fetch the message and assert on its subject, links or code.
What about SMTP?
Use smtp.mailtruss.com with any username and the sandbox key as the password, the same as production. The message arrives in the inbox marked SMTP.
Does the dark preview match Gmail or Apple Mail?
It is an approximation: it inverts colours the way many apps do. Mail apps differ from each other, so treat it as a guide to catch unreadable text, not as a guarantee.

Related: the free Will it land? checker, the sandbox documentation, and Mailtruss compared with Mailtrap.