HomeGuides › Disposable Email for Developers

Disposable Email for Developers: Testing Sign-Up and Reset Flows

Trigger sign-up in your test Get an inbox POST /api/inbox Poll for mail GET /api/messages Assert, then clean up DELETE /api/inbox
A typical end-to-end test loop — your code triggers a sign-up, the API mints a throwaway inbox, you poll until the verification mail lands, then assert on the code and clean up.

If you've ever built a sign-up form, you know the pain: testing the flow means burning through real email addresses, or spamming your own inbox with confirmation links. Disposable inboxes make that loop fast and clean.

Why developers reach for throwaway addresses

Manual testing vs. automation

For exploratory and manual QA, a temp-mail web inbox is perfect — generate an address, use it, read the result. For automated test suites, teams usually want an API (or a self-hosted catch-all) so a test can create an address, submit the form, then poll for the message programmatically. This very project is a small example of that pattern: a catch-all that parses inbound mail and exposes it over a simple API.

Heads-up

Public temp-mail inboxes are shared and unauthenticated — never route a real user's verification mail through one. Use them for your own test traffic only.

Build vs. borrow

If you only need to eyeball a confirmation email now and then, a public temporary inbox is the fastest route. If disposable email is core to your testing pipeline, consider running your own catch-all on a domain you control so addresses are private and the data is yours. Either way, the concept is the same one explained in how temp mail works.

Using the API in your tests, step by step

If you'd rather automate the loop than click through it by hand, TempMailPortal exposes the same inbox over a small HTTP API at https://api.tempmailportal.com. It's receive-only and CORS-enabled, so a test runner — or even browser-side code — can drive it. Here's the shape of a typical verification test; the API page has the exact request and response details, so check there rather than guessing at field names.

  1. Pick a mailbox domain. Call GET /api/domains to see which domains are currently live (today that's ynoxa.com). Domains rotate, so read them rather than hard-coding one.
  2. Create an address. POST /api/inbox mints a fresh mailbox and returns a token that authorises later reads for that address. Hold onto it for the rest of the run.
  3. Trigger your signup. Drive your app's registration or password-reset flow as usual, using the new address as the user's email so your transactional mail is sent to it.
  4. Poll for the message. Call GET /api/messages on an interval until the verification email lands. Inbound mail usually appears within seconds, but build in a sensible timeout and back off between polls.
  5. Read and extract. Fetch the full message with GET /api/messages/:id, then pull out the one-time code or confirmation link and feed it back into your assertion or your next request.
  6. Clean up. Call DELETE /api/inbox when the test finishes so you're not leaving addresses around. Anything you miss expires on its own anyway.
One token per address

The token you get from POST /api/inbox is scoped to that single mailbox — it's how the API knows the read is yours. Treat it like any other test fixture: create it at setup, use it through the run, drop it at teardown.

Fair use and limits

A free, shared service only stays free if nobody hammers it, so a few honest constraints are worth stating up front. The API is receive-only — it can accept inbound mail and let you read it, but it cannot send email, so it won't help you test outbound delivery from your own app. Messages auto-delete in about 24 hours (see how temp mail works for why the TTL is deliberately short), which is plenty for a test run but means it is not a place to park anything. And traffic is rate-limited and metered, so poll on a reasonable interval instead of in a tight loop. If you're wiring this into CI or anything heavier than occasional manual checks, read the acceptable-use and API-key notes on the API page first.

FAQ

Try it in one clickOpen a free temporary inbox right now — no signup, no password, auto-expiring.
Open Temp Mail