Skip to main content

Our email CSS engine is open source. Give it a star on GitHub 

Emailens
Email Sandbox and SMTP Relay

Catch every staging email
before a customer gets it.

Capture staging and test emails through an authenticated SMTP relay or a private receiving address. Inspect them, extract OTP codes in CI, and see how 21 email clients render them.

SMTP relay, STARTTLS

smtp.emailens.dev:2525

Private receiving address

inbox+…@try.emailens.dev

staging send, then the test

220 smtp.emailens.dev ESMTP

EHLO app.example.com

STARTTLS

AUTH PLAIN ••••••••

MAIL FROM:<auth@example.com>

Subject: Your verification code

250 Captured in your sandbox, not delivered

GET /api/sandbox/v1/messages/wait?subject=verification

message.otp = "492810"

One inbox, one way in

No conflicting setups. Choose how mail arrives when you create each sandbox inbox.

Email address sandbox

Direct inbound MX

A private receiving address for mail from third-party platforms, webhooks and transactional providers. No SMTP configuration.

inbox+clx9...@try.emailens.dev

  • Supabase Auth, Auth0, Clerk, Firebase
  • Stripe, Paddle, GitHub receipts
  • Real sends from Gmail, Outlook, Apple Mail
  • One-click address rotation

Authenticated SMTP relay

Port 2525 or 587

Point your backend mailer at Emailens. Outbound mail is captured in staging and never reaches a real customer mailbox.

smtp.emailens.dev:2525

  • Nodemailer, Laravel, Django, Rails, Go
  • STARTTLS enforced, TLS 1.2+
  • Credentials per developer or service
  • Zero-downtime rotation

More than a captured message

Emailens extracts what your tests need and checks how the message renders.

  • OTP and token extraction

    Six-digit codes, alphanumeric tokens and the primary link, parsed for you, so CI tests need no fragile regexes.

  • 21-client rendering

    Send any captured email to the rendering engine: Outlook's Word quirks, Gmail Android dark mode, Apple Mail.

  • Spam and deliverability

    SpamAssassin heuristics, SPF, DKIM and DMARC authentication headers, and Gmail's 102KB clipping limit.

  • Credential rotation

    Issue and rotate isolated SMTP credentials without breaking active runners. Passwords are stored hashed (SHA-256).

Emailens vs Mailtrap vs MailHog

Capture is the common ground. What happens after it is where they differ. Setting one up in Laravel, Rails, Django or Node: how to catch staging emails.

Feature Emailens Sandbox Mailtrap MailHog / Mailpit
Ingestion modes Direct MX and SMTP SMTP only SMTP only
Rendering across 21 email clients Per-client live preview Browser iframe only Browser iframe only
OTP and magic link extraction Built in Manual HTML parsing Manual HTML parsing
Long-poll endpoint for CI (/wait) One HTTP request Polling loops Polling loops
MCP server for AI coding agents Hosted MCP tools None None
SMTP credential rotation One click, UI or API Static shared token Unauthenticated or static

Connect your staging environment in minutes

No proprietary SDK. Standard SMTP, a REST API, and a remote MCP server.

Send through the relay. Connect on port 2525 with STARTTLS. Messages are held in your sandbox.

send-test-email.ts
import nodemailer from "nodemailer";

const mailer = nodemailer.createTransport({
  host: "smtp.emailens.dev",
  port: 2525, // Or port 587
  secure: false, // Upgrades automatically via STARTTLS
  requireTLS: true,
  auth: {
    user: process.env.EMAILENS_SMTP_USER, // e.g. esmtp_staging_clx9
    pass: process.env.EMAILENS_SMTP_PASS, // Generated per-service password
  },
});

await mailer.sendMail({
  from: '"Acme Auth" <auth@myapp.com>',
  to: "user@example.com", // Safely captured; never escapes to real recipient
  subject: "Your verification code: 492810",
  html: "<p>Your code is <b>492810</b>. Click <a href='https://myapp.com/verify?code=492810'>here</a> to verify.</p>",
});

Questions about the sandbox

How does the Emailens SMTP relay work?

The Emailens SMTP relay operates on smtp.emailens.dev over port 2525 (or port 587) with mandatory STARTTLS encryption. You configure your application or backend mailer (such as Nodemailer, Laravel, Django, or Rails) with dedicated per-service credentials. All outbound emails are quarantined inside your test inbox and are never relayed to external recipients.

What is the difference between Direct Email Inbound and the SMTP Relay?

Direct Email Inbound provides dedicated @try.emailens.dev receiving addresses to capture emails sent from external third-party services like Supabase, Auth0, Stripe, or personal email clients. The SMTP Relay allows your backend code to directly connect via standard SMTP on port 2525. Each Emailens sandbox inbox is dedicated to one ingestion type to guarantee zero configuration confusion.

How does Emailens differ from Mailtrap or local MailHog?

Mailtrap and MailHog only display emails inside standard browser preview iframes, which fail to catch rendering quirks in Outlook desktop (Microsoft Word engine), Gmail app dark mode color inversions, or mobile clipping. Emailens couples safe SMTP capture with an authentic 21-client cross-client visual rendering engine, automatic OTP token extraction for CI/CD, and an MCP server for AI coding assistants.

How do I extract OTP codes and magic links in Playwright or Cypress?

Emailens provides a long-polling wait endpoint: GET /api/sandbox/v1/messages/wait?inboxId=...&timeout=30. When an email arrives, Emailens automatically parses the MIME payload and extracts the 6-digit OTP code, hyphenated verification tokens, and primary CTA URLs, returning them as structured JSON so your end-to-end test can continue immediately.

How does zero-downtime SMTP credential rotation work?

Each SMTP inbox supports generating multiple isolated credentials. When rotating credentials, Emailens provisions a new username and password while allowing the previous credential to remain active during your service restart. Once your mailer is updated with the new secret, the old credential can be revoked in one click with immediate termination.

Can AI coding agents like Claude or Cursor access the sandbox?

Yes. Emailens includes a remote Model Context Protocol (MCP) server. By connecting Cursor, Windsurf, or Claude Desktop to https://app.emailens.dev/api/mcp, AI agents can autonomously list test inboxes, inspect captured emails, extract login links, and verify authentication loops.

Stop guessing how emails look in staging.

Capture real staging messages, finish CI authentication runs, and see 21 email clients in one place.

Open Email Sandbox