Test every email
your app sends

Send to any @mailiator.dev address, fetch via REST API. Built for E2E tests, CI pipelines, and AI agents.

API Documentation Get Started

Works with your stack & AI agents

Playwright Cypress Selenium Puppeteer GitHub Actions GitLab CI Claude Code Cursor ChatGPT
terminal
# register (one-time)
curl -X POST https://mailiator.dev/api/register \
  -H "Content-Type: application/json" \
  -d '{"name":"my-ci"}'
# → open verification URL in browser

# generate a random address (or use any name@mailiator.dev)
curl https://mailiator.dev/api/generate-email
# {"email": "gentle-fox-42@mailiator.dev"}

# fetch inbox (long poll — wait in seconds, adjust to suit your test)
curl https://mailiator.dev/api/inbox/gentle-fox-42@mailiator.dev?wait=10 \
  -H "Authorization: Bearer ml_xxx"

Usage

import { test, expect } from '@playwright/test'

test('receives verification email', async ({ request }) => {
  // 1. Use any address or generate a random one
  const res = await request.get('https://mailiator.dev/api/generate-email')
  const { email } = await res.json()

  // 2. ... trigger your app to send email to `email` ...

  // 3. Fetch inbox (long poll — wait in seconds)
  const inbox = await request.get(
    `https://mailiator.dev/api/inbox/${email}?wait=10`,
    { headers: { 'Authorization': `Bearer ${API_KEY}` } }
  )
  const emails = await inbox.json()

  // 4. Assert
  expect(emails.length).toBeGreaterThan(0)
  expect(emails[0].subject).toContain('Verify your email')
})
describe('Email verification', () => {
  it('receives verification email', () => {
    // 1. Use any address or generate a random one
    cy.request('https://mailiator.dev/api/generate-email')
      .its('body.email')
      .then((email) => {
        // 2. ... trigger your app to send email to `email` ...

        // 3. Fetch inbox (long poll — wait in seconds)
        cy.request({
          url: `https://mailiator.dev/api/inbox/${email}?wait=10`,
          headers: { 'Authorization': `Bearer ${Cypress.env('API_KEY')}` }
        }).then((res) => {
          // 4. Assert
          expect(res.body).to.have.length.greaterThan(0)
          expect(res.body[0].subject).to.include('Verify your email')
        })
      })
  })
})
// Add to your MCP config (Claude Code, Cursor, etc.):
{
  "mcpServers": {
    "mailiator": {
      "type": "streamable-http",
      "url": "https://mailiator.dev/mcp"
    }
  }
}

// The AI agent gets direct access to tools:
// generate_email, check_inbox, get_email,
// delete_emails, register
//
// Or discover the API automatically via
// OpenAPI spec, llms.txt, and AI plugin manifest.

How it works

01 Register via POST /api/register and verify in browser (one-time)
02 Pick any @mailiator.dev address or generate a random one via GET /api/generate-email
03 Have your app send email to that address
04 Fetch via GET /api/inbox/:email?wait=N — N is seconds, adjust to suit your test, then assert content

Pricing

Free
$0/mo
50 requests/day
Pro
$19/mo
3,000 requests/day
View Plans

Why Mailiator

Real SMTP emails
Not mocked, not simulated. Your app sends a real email via SMTP, Mailiator receives it, and you fetch it through the API. Test the actual flow your users experience.
REST API — any language
Simple HTTP endpoints. No SDK required. Works with curl, Playwright, Cypress, Selenium, or any language that can make HTTP requests. OpenAPI spec and AI-friendly docs included.
Long polling — no retries
Add ?wait=N (seconds) to your inbox request. The API holds the connection until an email arrives or the timeout expires. Set a short wait for fast tests, longer for slow mail flows. No polling loops, no sleep hacks, no flaky waits.
Auto-cleanup
Emails are automatically deleted after 30 minutes. No stale test data, no manual cleanup, no privacy concerns. Each test run starts clean.
One-time setup
Register via API, verify once in the browser, and you're done. No OAuth, no onboarding wizard, no credit card. Start testing in under a minute.
AI agent ready
MCP server, OpenAPI spec, llms.txt, and AI plugin manifest built in. Claude Code, Cursor, and ChatGPT can connect via MCP or discover the API automatically.