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.

Email is often the awkward part of testing a sign-up flow. Reusing your own address contaminates the test, while creating permanent test accounts leaves a mess to clean up. A disposable inbox gives each run a fresh recipient without pretending that public temp mail is suitable for real users.

Why developers reach for throwaway addresses

Manual testing vs. automation

For a manual check, the browser inbox is enough: create an address, submit the form and read what arrives. A repeatable test needs an API or a catch-all you control, because the runner has to create an address and poll without a person clicking around. TempMailPortal uses that same pattern. Its catch-all parses incoming mail and exposes the result through a small API; Cloudflare's Email Worker reference documents the email() handler behind the receiving side.

Heads-up

Public temp-mail inboxes are low-trust and address-based rather than protected by a private user account. Never route a real user's verification mail through one; use them only for test traffic you control.

Build vs. borrow

For the occasional confirmation email, a public inbox saves setup time. For CI or a test suite that runs every day, use a domain and catch-all your team controls; that gives you predictable retention, private addresses and control over rate limits. The receiving path is the same one described in how temp mail works, but the operational trade-off is very different.

A practical API test loop

TempMailPortal exposes the browser inbox through an HTTP API at https://api.tempmailportal.com. It is receive-only and CORS-enabled, so a test runner or browser test can use it directly. The sequence below is the part worth remembering; the API page remains the reference for exact fields and limits.

  1. Pick a mailbox domain. Call GET /api/domains to see which domains are currently live (today that's namesgeneratorhub.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. Delivery time varies with the sender and receiving path, so 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 later messages cannot be mistaken for the next run. Cleanup also makes retries easier to reason about. Anything you miss expires on its own.
One token per address

The token from POST /api/inbox authorises reads for one mailbox, but it is not private user-account authentication: a custom local-part can be requested again. Treat the token as a short-lived test fixture and never use the inbox for sensitive or real-user mail.

A live API smoke test

We ran the sequence below against https://api.tempmailportal.com on 30 August 2026. It created a random ten-character address, read the empty inbox, tried a modified token, deleted the inbox and read it again. The token and complete address were deliberately omitted from the recorded output.

RequestStatusOne-run timeResult
GET /api/domains200820 msnamesgeneratorhub.com was active
POST /api/inbox200368 msA ten-character local part and token were returned
GET /api/messages200200 msThe new inbox returned an empty array
Read with a modified token401116 msThe request was rejected
DELETE /api/inbox200180 msThe API returned {"ok":true}
Read after deletion200195 msThe same token reached the address, now with zero messages

Those timings describe one smoke-test run, not a latency promise or load test. The final read exposes an important detail for test cleanup: deletion clears stored messages, but it does not revoke the stateless token or reserve the address. Always use a fresh random inbox for the next test run.

Fair use and limits

The public API is shared infrastructure, not an unlimited test dependency. It receives mail but cannot send it, messages expire after about 24 hours, and requests are rate-limited and metered. Poll with a delay and a real timeout rather than a tight loop. If the test is business-critical or high-volume, run your own receiving domain instead of building around a free endpoint. The acceptable-use and API-key notes on the API page spell out the current limits.

Questions developers usually ask

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