product
Disposable email API
Create private disposable inboxes for QA, CI, and automation. Test signup, OTP, password reset, and notification flows with isolated MailSlurp addresses.
A disposable email API gives your team fresh inboxes for every test or workflow run. Instead of reusing shared addresses or depending on public temp-mail websites, you create private inboxes in code, run assertions, and clean up automatically.
MailSlurp is built for this exact pattern: deterministic inbox provisioning, wait-for APIs, and message parsing helpers designed for engineering and QA teams.
What this page is for
Use this route when your primary goal is test isolation and automation reliability.
- Create one inbox per test run, worker, or suite.
- Validate signup, OTP, and password-reset emails without collisions.
- Stop leaking QA traffic into real customer addresses.
- Replace manual mailbox checks with CI-safe assertions.
- Create MailSlurp-owned disposable addresses for demos, test users, screenshots, and support reproduction.
If your use case is broader inbox infrastructure, see Email address API. If you need short-lived production/privacy workflows, see Temporary email API.
Disposable email API vs temporary email API
Use the distinction this way:
- Disposable email API: create a clean, private inbox for a test, worker, signup journey, or automation run.
- Temporary email API: create an inbox with explicit expiry and retention policy for short-lived privacy or staged workflows.
- Fake email generator: use a fast browser-based tool for manual checks before you build the API workflow.
For fast manual checks, open the fake email generator. For broader inbox provisioning, use Email address API. For retrieval-focused tests, use Receive email API.
Disposable inbox workflow in CI
- Create a disposable inbox before test execution.
- Trigger your app flow (signup, invite, recovery, notification).
- Wait for the message by criteria (subject/sender/time window).
- Extract code or link and assert expected behavior.
- Expire or delete inbox artifacts when tests finish.
import { MailSlurp } from "mailslurp-client";
const mailslurp = new MailSlurp({ apiKey: process.env.MAILSLURP_API_KEY! });
const inbox = await mailslurp.createInboxWithOptions({
expiresIn: 30 * 60 * 1000,
tags: ["ci", "auth-flow"],
});
await app.requestPasswordReset(inbox.emailAddress!);
const email = await mailslurp.waitController.waitForLatestEmail({
inboxId: inbox.id!,
timeout: 45_000,
unreadOnly: true,
});
const links = await mailslurp.emailController.getEmailLinks({ emailId: email.id! });
expect(links.links?.length).toBeGreaterThan(0);
Why MailSlurp disposable email works better for teams
| Requirement | Public temporary inbox websites | Disposable email API |
|---|---|---|
| Private inbox ownership | Usually no | Yes |
| CI automation | Limited or brittle | Native |
| Parallel tests without collisions | Hard | Straightforward |
| Structured waiting and parsing | Rare | Built-in |
| Lifecycle and cleanup controls | Weak | Explicit |
MailSlurp turns disposable email into a repeatable engineering workflow: create the inbox, run the flow, wait for the message, extract the data, assert the result, and expire the address.
High-ROI use cases
- Signup verification: Validate account activation links per environment.
- Password reset reliability: Catch template/link regressions before release.
- OTP and magic-link auth: Assert code format, expiry messaging, and fallback behavior.
- Notification QA: Confirm transactional events produce correct recipient content.
- Contract testing: Verify third-party systems send expected emails after API actions.
Yopmail-style disposable email without shared inbox risk
Shared public disposable inboxes are fast for manual checks, but they create uncertainty for teams: addresses can be reused, messages can be visible to others, and automation is usually brittle.
MailSlurp gives the same disposable-email speed with private ownership:
- one inbox per run, worker, tenant, or workflow
- real email delivery into a controlled inbox
- message waits that stop when the exact email arrives
- link, OTP, header, and attachment extraction
- expiry and cleanup policies for disposable identities
Use this when disposable email needs to support CI, release gates, auth tests, demos, and repeatable product QA.
Disposable email generator to API workflow
Manual checks can start with the fake email generator. Production-like tests should move into the MailSlurp API:
- Provision a disposable inbox with tags for environment and test name.
- Use the generated address in the signup, invite, reset, or notification flow.
- Wait for a matching email instead of sleeping.
- Extract the required link, code, sender, subject, body, or attachment metadata.
- Store the MailSlurp email ID in CI artifacts for debugging.
Common implementation mistakes to avoid
- Reusing the same inbox across parallel tests.
- Relying on fixed
sleepdelays instead of wait-for APIs. - Ignoring message IDs in CI artifacts (harder post-failure debugging).
- Keeping disposable inboxes forever without retention policy.
- Mixing staging and production sender identities in one test pool.
Related MailSlurp routes
- Email integration testing
- Email Sandbox API
- Temporary email API
- Email testing tools
- Wait for emails API guide
Next step
Start by converting one manual email assertion in your CI pipeline to an API-based disposable inbox flow, then roll the pattern across all auth-critical journeys. Create a free account with the MailSlurp testing setup.
FAQ
What is a disposable email API?
A disposable email API creates private, short-lived inboxes from code so tests and automated workflows can receive real emails without shared mailbox state.
Can MailSlurp replace public disposable email generators for QA?
Yes. MailSlurp gives teams private disposable inboxes, deterministic waits, parsing helpers, expiry controls, and SDKs for repeatable QA.
Can disposable inboxes receive OTP codes and magic links?
Yes. Create a disposable inbox, trigger the auth flow, wait for the message, extract the OTP or link, and complete the test before cleanup.