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
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, 2026Why 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, 2026Getting 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, 2026Reading 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, 2026Plus 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, 2026Cleaning 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, 2026Testing 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, 2026What 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, 2026Testing 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 →Auth providers
Testing Firebase Auth emails: emulator links vs a real inbox
The Auth emulator sends no email; read links from its oobCodes endpoint. Test the template, action URL and delivery against a staging project.
Read →October 17, 2026Testing Supabase Auth emails: Mailpit locally, SMTP on staging
The built-in email service only delivers to your team, 2 an hour. Use Mailpit locally and custom SMTP on staging, and mind the 60-second rate limit.
Read →October 17, 2026Testing Clerk sign-ups: +clerk_test addresses or a real inbox
+clerk_test addresses take the code 424242 and get no email. Keep a few real-email tests, and watch the 100-a-month cap on development instances.
Read →October 17, 2026Testing Cognito sign-up emails: the 50-a-day limit and the code
Default Cognito email allows 50 messages a day per AWS account. Send tests through your own SES, read the code, and skip email with AdminConfirmSignUp.
Read →October 17, 2026Testing Auth0 verification emails past the built-in provider
Auth0's built-in email sends 10 a minute with no custom templates, so parallel tests break. Use your own provider on staging and tickets elsewhere.
Read →Frameworks, CI and delivery
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, 2026Sandbox 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, 2026Mailpit 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, 2026Why 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, 2026Django 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, 2026Rails 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, 2026Laravel 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 →