SMTP sandbox

SMTP sandbox

Point your app’s SMTP settings here. Every email it sends is stored in your sandbox, where you can open it or read it through the API. Nothing is delivered to the real recipients. If you have used Mailpit or MailHog, this is the same idea, hosted.

A sandbox needs a free account. You get the username and password when you create it.

Settings

Hostsmtp.mail7.app
Port2525
Usernamesbx_…Your sandbox ID
Passwordm7s_…Shown once, when you create or reset it
AuthenticationPLAIN or LOGIN
EncryptionNone. Turn TLS, SSL and STARTTLS off.

This port has no TLS. The username and password travel unencrypted, and so does the mail.

That is acceptable for what a sandbox holds. The password is a throwaway made for one sandbox. All it can do is add mail to that sandbox. It cannot read mail, and it has nothing to do with your account password or API keys. If it leaks, make a new one under My sandboxes and the old one stops working at once. Do not send real customer data through a sandbox. If a network must not carry plain SMTP, use the HTTPS endpoint below.

Set up your app

Keep the username and password in environment variables, and use these settings only in development, CI and staging.

mailer.js
import nodemailer from 'nodemailer';

const transport = nodemailer.createTransport({
  host: 'smtp.mail7.app',
  port: 2525,
  secure: false, // this port has no TLS
  auth: { user: process.env.MAIL7_SMTP_USER, pass: process.env.MAIL7_SMTP_PASS },
});

await transport.sendMail({
  from: 'App <app@example.test>',
  to: 'anyone@example.test', // captured, never delivered
  subject: 'Welcome',
  html: '<p>Your code is <b>482913</b></p>',
});

No SMTP? Post the message over HTTPS

Send a raw email (RFC 822, a .eml file) as the request body. It lands in the sandbox like a message sent over SMTP. This path is encrypted and uses your API key.

Terminal
curl -X POST https://api.mail7.app/v1/inboxes/sbx_…/messages \
  -H "Authorization: Bearer m7_…" \
  --data-binary @mail.eml

Read what was captured

Open the sandbox in the Mail window to see each message as HTML, text, raw source, headers and links. New mail shows up as it arrives. From a test, wait for the message and assert on it:

Terminal
curl "https://api.mail7.app/v1/inboxes/sbx_…/wait?timeout=30&subject=Welcome" \
  -H "Authorization: Bearer m7_…"
# {"subject":"Welcome","to":["anyone@example.test"],"otp":"482913", …}

to lists every recipient your app named, so you can check who would have got the email. More in the API docs.

How the server behaves

  • Every recipient is accepted, up to 100 per message. No address is checked and nothing is sent on.
  • You must log in before sending. A wrong username or password gets 535.
  • Messages can be up to 5 MB. Bigger ones get 552.
  • A sandbox keeps its newest 200 messages, for 7 days. Older ones are removed.
  • You can send several messages on one connection. A connection that is silent for 60 seconds is closed.
  • STARTTLS is answered with 502. If your client insists on it, turn it off in the client.
Mail7

No new notifications

New mail shows up here.