March 28, 2026

Generate Test Email Addresses Instantly with Tag-Based Addresses

Tag-Based AddressesTestingAPI

What Are Tag-Based Addresses?

MailBrew's tag-based addresses let you receive emails at {anything}@{company}.mailbrew.dev:

[email protected]
[email protected]
[email protected]

These addresses don't need to be created via API first. Just send an email and it automatically arrives at MailBrew.

Traditional vs Tag-Based

Traditional: Create via API

// 1. Call API to create address (network latency)
const addr = await mb.addresses.create({ ttl: 300 });

// 2. Use the created address
await page.fill('[name="email"]', addr.address);

Tag-Based: Use Immediately

// Generate UUID and use directly (no API call)
const addr = `test-${crypto.randomUUID()}@acme.mailbrew.dev`;
await page.fill('[name="email"]', addr);

Benefits

  1. Zero latency — No API calls, address generation is instant
  2. No rate limits — Doesn't hit API rate limits since no API is used
  3. Perfect for parallel tests — UUIDs guarantee no collisions
  4. Simple — No need to even import the SDK

Usage Patterns

Pattern 1: Per-Test Addresses

test('signup flow', async ({ page }) => {
  const email = `signup-${Date.now()}@acme.mailbrew.dev`;
  // ...
});

Pattern 2: Per-Service Addresses

In microservice environments, use service-specific prefixes:

auth-service-{id}@acme.mailbrew.dev
billing-{id}@acme.mailbrew.dev
notification-{id}@acme.mailbrew.dev

Pattern 3: Multi-Language Testing

const locales = ['ja', 'en', 'zh'];
for (const locale of locales) {
  const email = `lang-test-${locale}@acme.mailbrew.dev`;
  await testSignupFlow(email, locale);
}

Retrieving Emails

Emails sent to tag-based addresses can be retrieved via the standard API:

const emails = await mb.addresses.waitForEmail(
  `[email protected]`,
  { timeout: 30 }
);

Combined with Custom Domains

On Pro plans and above, combine custom domains with tag-based addresses:

test-{id}@mail.your-company.com

Test with your own domain's email addresses, even for applications with domain-based validation.

Summary

Tag-based addresses make test email address generation zero-cost. Especially ideal for parallel E2E test execution and CI environments.

Try it now →

← Back to blog
© 2026 MailBrew