Email receiving API for E2E testing and QA

Check emails in your E2E tests
with a few lines of test code

Create test addresses through the API, then pull verification codes and links out of delivered emails inside your tests. Playwright and Cypress helpers are published on npm.

No credit card required · Free plan: up to 100 emails/month and 5 addresses

$npm install -D @mailbrew/playwright
tests/signup.spec.js
import { test, expect } from '@mailbrew/playwright';

test('signup', async ({ page, mailbox }) => {
  const addr = await mailbox.createAddress();

  await page.goto('/signup');
  await page.fill('#email', addr.address);
  await page.click('#submit');

  const email = await mailbox.waitForEmail(addr.address, {
    where: { subject_contains: 'Verify' },
    extract: 'otp',
  });

  await page.fill('#otp', email.extracted.otp.code);
  await expect(page).toHaveURL('/welcome');
});
Test result
✓ signup › verifies the email address with the code
email.extracted.otp.code "284917"

How it works

Two ways to receive

Receive through the API from your tests, or point your app’s SMTP at MailBrew. Both land in the same inbox.

  1. 01

    Create an address

    Create an address per test through the API, optionally with a TTL.

  2. 02

    Send from your app

    Enter that address in the app under test and trigger the email.

  3. 03

    Receive in the test

    Wait up to 60 seconds for it to arrive, then check the subject, body, verification code, and links.

# 1. Create an address
curl -X POST https://mailbrew.dev/api/mailbrew/addresses \
  -H "X-API-Key: $MAILBREW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ttl": 3600}'
# → { "data": { "address": "[email protected]", ... } }

# 3. Wait for the email (up to 60 s) and extract the code
curl "https://mailbrew.dev/api/mailbrew/addresses/[email protected]/emails/wait?timeout=60&extract=otp" \
  -H "X-API-Key: $MAILBREW_API_KEY"

Dashboard

Received emails and test results, on one screen for your team

Check delivered emails as HTML, text, or raw source, and download them as .eml.

MailBrew dashboard — MailboxMailBrew dashboard — Test ResultsMailBrew dashboard — Activity (audit log)

Features

Features for your tests

Verification code extraction

Add extract to the wait call and the extracted code comes back with the email. Common formats need no regex.

const email = await mailbox.waitForEmail(addr.address, {
  extract: 'otp',
});
email.extracted.otp.code; // "284917"

Wait for the right email

Wait only for an email that matches the subject or sender, so a welcome email that arrives first does not break your test.

await mailbox.waitForEmail(addr.address, {
  where: { subject_contains: 'Verify' },
});

Link extraction

Pull password reset and invitation links out of the body, open the page, and continue the test.

const [url] = await mailbox.extractLinks(
  addr.address, email.id, { pattern: 'reset' },
);
await page.goto(url);

Assertion API

Check subject, sender, and body conditions in one call. Results stay on the Test results screen.

POST /api/mailbrew/addresses/{address}/emails/{id}/assert
{ "subject_contains": "Welcome", "body_contains": "verify" }
→ { "data": { "passed": true, ... } }

Running in CI

A GitHub Actions action is published. Add the X-MailBrew-Run-Id and X-MailBrew-Commit headers to your API calls and results are grouped per CI run.

- uses: FUNBREW/mailbrew-actions/setup@v2
  with:
    api-key: ${{ secrets.MAILBREW_API_KEY }}

Webhooks

POSTs to your URL when an email arrives. Filter by subject and other conditions to trigger your own processing.

POST /api/mailbrew/webhooks
{ "url": "https://your-app.example/hook",
  "filter": { "subject_contains": "Order" } }

Security

Test emails, governed by your own rules

Test emails carry verification codes and invitation links, so access controls are included on every plan.

Required two-factor authentication
Require authenticator-app 2FA for everyone in your organization.
IP restrictions
Limit the dashboard, API, and login to IP addresses you allow.
Roles
Three roles: Owner, Member, and Mailbox only.
Audit log
Records logins, email views, downloads and deletions, and settings changes. Export as CSV.
Operator access is logged
If our operators need to view your email, for example to investigate an incident, they ask for your consent first, and the time, reason, and scope are recorded in your audit log.
Automatic deletion
Emails and their attachments are deleted 7 days after they arrive. You can shorten this in your settings.

Use Cases

Automate tests for email-driven flows

Ways to use MailBrew in development, testing, and security checks

Pricing

Pricing

From small projects to large teams

Billed in Japanese yen (JPY), tax included · Two-factor authentication, IP restrictions, and audit logs are available on all plans

Once you reach the monthly email limit, you cannot create new addresses through the API that month, but emails keep arriving

Free

¥0
Emails100 emails/mo
Addresses5
Rate limit10 req/min
Email retention7 days
-REST API
-Webhooks
-Address expiry (TTL)
-Team sharing
Get started free

Starter

¥1,980/mo
Emails1,000 emails/mo
Addresses20
Rate limit30 req/min
Email retention7 days
-Everything in Free
Get started

Pro

¥9,800/mo
Emails10,000 emails/mo
Addresses100
Rate limit120 req/min
Email retention7 days
-Everything in Starter
-Extra monthly emails by quote (contact us)
Get started

Enterprise

¥49,800/mo
EmailsUnlimited
AddressesUnlimited
Rate limitUnlimited
Email retention7 days
-Everything in Pro
-Annual invoice billing (by separate agreement)
-Contracts and NDAs on your own templates
-SLA and audit cooperation by separate agreement on request
Contact us

FAQ

Frequently asked questions

Can test emails accidentally reach real customers?
If you send to MailBrew addresses, or point your app SMTP settings at MailBrew, the emails land in your MailBrew inbox. MailBrew does not send them anywhere else, except when you forward a specific email or to webhook URLs you configure yourself.
Does it work with Playwright and Cypress?
Yes. A Node.js SDK, helpers for Playwright and Cypress, and a command-line tool are published on npm. Other languages and frameworks can use the REST API directly.
How long are received emails kept?
Emails are deleted automatically, together with their attachments, 7 days after they are received. Your organization can set a shorter period.
Can we see who viewed which email and when?
Yes. The audit log records sign-ins, email views, downloads and deletions, and changes to members and settings, with the time, user, and IP address, and can be exported as CSV. Owners can see the records of everyone in the organization. If our staff ever view your emails, for example to investigate an incident, that is recorded in your audit log as well.

Use it in your next E2E test

Once you sign up, you can issue an API key and your first address right away.
No credit card required.
Free plan: up to 100 emails/month and 5 addresses

Create free account →