Skip to content

Test the emails your app sends

Every endpoint on a webhooks.cc account has a real email address next to its webhook URL. Sign up in your app with it, then read the confirmation code, the magic link and the sender checks in the dashboard, or fetch the email from the API in your test.

# Your endpoint's address
[email protected]

# One per test run, same endpoint
[email protected]
Start free:

No credit card. Read the email capture docs for every detail.

How to test an email flow

  1. 1

    Create an endpoint

    Sign up free and create an endpoint. Next to its webhook URL it has an email address: the endpoint's slug at mailhooks.cc.

  2. 2

    Use the address in your app

    Sign up, reset a password or log in with that address. Add a tag after a plus sign, like [email protected], to tell test runs apart; tagged mail lands on the same endpoint.

  3. 3

    Read the email

    The email appears in the dashboard within seconds, with the one-time code and the main link picked out for you. In an automated test, fetch it from the REST API instead.

  4. 4

    Check it before you ship

    Preview the HTML at desktop and mobile widths, read the text part and the headers, and see whether SPF, DKIM and DMARC passed for your sending domain.

What you see for every email

Codes and links, picked out

The one-time code and the link the email asks you to click sit at the top, each with a copy button. Unsubscribe and tracking links stay out of the way.

A preview that cannot bite

The HTML renders in a sandboxed frame with no scripts. Remote images wait until you load them, so opening an email tells the sender nothing.

Sender checks

SPF, DKIM, DMARC, reverse DNS and TLS for every message, with what each result means, so you see what an inbox provider would think of your mail.

The email as JSON

Every email opens on a JSON view of the parsed message: sender, recipients, subject, text, HTML, codes, links and attachments. Copy it as a test fixture.

Emails next to your webhooks

Mail lands in the same list as the endpoint's HTTP requests, so a signup that fires a webhook and a confirmation email can be checked in one place.

Headers, raw source and .eml

Every header as it arrived, the raw message, the attachment list, and a download of the original .eml file.

Read the email in your test

The REST API returns emails next to HTTP requests, each with its parsed message. Poll for the email your test triggered, then pull the code or link out of it. This works in Playwright, Cypress, Selenium or any test runner that can make an HTTP call.

// Your signup test used `my-app+${runId}@mailhooks.cc`.
async function waitForEmail(runId: string, since: number) {
  for (let attempt = 0; attempt < 30; attempt++) {
    const response = await fetch(
      `https://webhooks.cc/api/endpoints/my-app/requests?since=${since}`,
      { headers: { Authorization: `Bearer ${process.env.WHK_API_KEY}` } }
    );
    const requests = await response.json();
    const match = requests.find((r) => r.kind === "email" && r.email.tag === runId);
    if (match) return match.email;
    await new Promise((resolve) => setTimeout(resolve, 1000));
  }
  throw new Error("No email arrived within 30 seconds");
}

const email = await waitForEmail(runId, startedAt);
const code = email.text.match(/\b\d{6}\b/)?.[0];
await page.getByLabel("Verification code").fill(code);

Create the API key on your account page. The REST API reference lists every field of an email.

Need the email in your own app?

Turn on forwarding and every email the endpoint receives is posted to your server as signed JSON, retried until your server accepts it. No mail server to run and no MIME to parse.

Email to webhook

Limits

  • Every plan, Free included; an email counts as one request
  • Messages up to 10 MB, up to 20 recipients each
  • Text and HTML stored up to 256 KB each
  • Original .eml kept for messages up to 1 MB
  • Attachments listed by name, type and size
  • Same retention as your HTTP requests

Email testing questions

Your test inbox is one signup away

Sign up free, create an endpoint, and send your first email to it.

No credit card