Playwright email testing

Use PostMX in Playwright for real email flows

Create an inbox at the start of a Playwright test, send your app email to that address, and continue the browser flow with the OTP or magic link returned by the API.

No credit card required ยท Start free in minutes

Node SDK example

import { PostMX } from "postmx";

async function main() {
  const postmx = new PostMX(process.env.POSTMX_API_KEY!);
  const inbox = await postmx.createTemporaryInbox({ label: "signup-test" });
  console.log("Send your app email to:", inbox.email_address);
  const message = await postmx.waitForMessage(inbox.id);
  console.log("OTP:", message.otp);
}

main().catch(console.error);

Start building today

Bring real inboxes into Playwright

Test browser flows against the emails your application actually sends.