Email receiving API for E2E testing and QA
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/playwrightimport { 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');
});How it works
Receive through the API from your tests, or point your app’s SMTP at MailBrew. Both land in the same inbox.
Create an address per test through the API, optionally with a TTL.
Enter that address in the app under test and trigger the email.
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
Check delivered emails as HTML, text, or raw source, and download them as .eml.



Features
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 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' },
});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);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, ... } }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 }}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 carry verification codes and invitation links, so access controls are included on every plan.
Use Cases
Ways to use MailBrew in development, testing, and security checks
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
FAQ
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