Send to any @mailiator.dev address, fetch via REST API. Built for E2E tests, CI pipelines, and AI agents.
# 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"
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.
POST /api/register and verify in browser (one-time)
@mailiator.dev address or generate a random one via GET /api/generate-email
GET /api/inbox/:email?wait=N — N is seconds, adjust to suit your test, then assert content
?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.