Blog

Testing the email step

Short, practical answers for engineers who test sign-up, reset and login emails: with code, sources and the limits stated plainly.

Reading the email in a test

October 16, 2026

How long should a test wait for an email?

Wait for the first email with one long-poll request, set the test timeout above it, and count API requests per run before you pick a plan.

Read →
October 16, 2026

Why your E2E test opened the wrong email

Reused addresses, a second email to the same inbox and parallel workers. Four causes of a test reading the wrong email, and how to rule each out.

Read →
October 16, 2026

Getting the verification link out of an email (and why click tracking breaks it)

Pick the link by text or path, not position. Click tracking rewrites URLs to the provider's domain: turn it off for staging or follow the redirect.

Read →
October 16, 2026

Reading a one-time code from an email without false matches

A bare \d{6} matches order numbers and dates. Anchor the pattern to the words around the code, normalize the text and require exactly one match.

Read →
October 16, 2026

Plus addressing, catch-all and subdomains: how test email addresses work

Plus addresses share one mailbox, catch-all needs your own domain, subdomain inboxes need DNS. How each format routes mail, and what that means for tests.

Read →
October 16, 2026

Cleaning up after email tests: delete over the API or let retention do it

Temporary test mail expires on its own. Delete over the API when inboxes are reused or hold personal data, and count the requests it costs.

Read →
October 17, 2026

Testing email attachments: PDFs, invoices and exports

Pick the file by name and type, check its first bytes, and read the PDF's text for the order number. Inline logos show up as attachments too.

Read →
October 17, 2026

What to check in email headers: Reply-To, Message-ID, unsubscribe

Assert Reply-To, a valid Message-ID and one-click List-Unsubscribe, check DKIM signs the list headers, then send the RFC 8058 POST yourself.

Read →
October 17, 2026

Testing email-change and double opt-in flows

Two inboxes for an email change, two emails for double opt-in. Assert the order: nothing changes or arrives before the right link is opened.

Read →

Frameworks, CI and delivery

October 16, 2026

Testing emails in GitHub Actions

Store the API key as a secret, build addresses from GITHUB_RUN_ID and GITHUB_RUN_ATTEMPT, and know why pull requests from forks get no secrets.

Read →
October 16, 2026

Sandbox modes of SendGrid, Postmark, Resend and SES: what gets delivered

In sandbox or test mode most providers accept the email and deliver nothing. What each one does, and how to test real delivery from staging.

Read →
October 16, 2026

Mailpit locally, a real inbox on staging: where each one fits

Mailpit catches SMTP on your machine; it can't see mail sent through a provider's API. Use it locally and a real inbox where delivery matters.

Read →
October 16, 2026

Why emails from staging land in spam: SPF, DKIM and DMARC

Staging often sends from a domain with no SPF, an unsigned DKIM or a From that doesn't align. How to read the headers of a received email and fix it.

Read →
October 17, 2026

Django email tests: what mail.outbox checks and what it can't

Django's test runner swaps in the locmem backend, even for LiveServerTestCase. Use mail.outbox for content and a real inbox on staging for delivery.

Read →
October 17, 2026

Rails email tests: deliveries, deliver_later and a real inbox

Test mode fills ActionMailer::Base.deliveries; deliver_later waits for perform_enqueued_jobs. Staging interceptors and hosts need a real inbox.

Read →
October 17, 2026

Laravel email tests: Mail::fake, Dusk and a real inbox

Mail::fake covers mailables in feature tests but not Dusk, which runs the app separately. On staging, alwaysTo and queues can stop real email.

Read →

Test the email step in your suite

Free plan. Send to any address and read it back.

Start free