MailSlurp logo

Create real inboxes and phone numbers from code.

Provision an identity, receive the real email or SMS, and assert the result in the test framework and language you already use.

tests/signup-otp.spec.ts - MailSlurp
TSsignup-otp.spec.ts
tests/e2e/signup-otp.spec.ts
1import { test, expect } from "@playwright/test";
2import { MailSlurp } from "mailslurp-client";
3
4test("sign up with email OTP", async ({ page }) => {
5 const mailslurp = new MailSlurp({ apiKey: process.env.MAILSLURP_API_KEY! });
6 const inbox = await mailslurp.createInbox();
7
8 await page.goto("/signup");
9 await page.getByLabel("Email").fill(inbox.emailAddress!);
10 await page.getByRole("button", { name: "Create account" }).click();
11
12 const email = await mailslurp.waitForLatestEmail(inbox.id!, 30000);
13 const code = email.body!.match(/\b\d{6}\b/)![0];
14 await page.getByLabel("Code").fill(code);
15 await expect(page.getByText("Welcome")).toBeVisible();
16});
mainTypeScript Ln 11, Col 1

Trusted by top companies worldwide

  • Broadcom
  • Scraper
  • Trivago
  • Avast
  • Wolt
  • Panasonic
  • Broadcom
  • Scraper
  • Trivago
  • Avast
  • Wolt
  • Panasonic

From one API call to a verified result.

MailSlurp gives the test a real identity, waits for the real message, and keeps the assertion with the build.

MailSlurp SDK code for creating an inbox
01

Create an isolated identity

Create a new inbox or phone number for the run, or reserve a long-lived identity for an application or agent.

A real SMS verification message received on a phone
02

Receive the real message

Wait for email or SMS, match content, extract an OTP or link, and inspect headers and attachments.

MailSlurp email and OTP assertions passing in CI
03

Assert it in CI

Run the customer journey in Playwright, Cypress, Selenium, Postman, or your own test runner and keep the evidence.

Global messaging scale

Emails processed

500 million+

Infrastructure that scales.

Mobile networks

20+

Leverage global telecom networks.

Mature platform

10+ years

Stable and dependable.