Teams that test email verification often stop at the happy path: the code arrives, the user enters it, the account is confirmed. Bugs hide at the edges: expired codes and codes replaced by a resend. Below: the mailbox, the API and three test cases.
Which mailbox fits your staging environment
turbon.rent has three email products, and only one suits testing your own app. One-off email activation serves sites from our catalog and keeps the latest letter — see What Is Email OTP. A mailbox rented "for specific sites" accepts letters only from the listed sites. A full mailbox accepts all incoming mail with no site selection — that is the one for QA.
The domain comes from the mail provider's catalog and the name before the @ is random, with no custom names or own domains; allowlist the domain if staging restricts sign-ups. The mailbox has never been used before, and after the rental ends it is not issued to another customer. Terms come from the shop's price grid, with renewal and auto-renewal; there are no refunds or cancellations, so match the term to your test cycle.
What a letter shows: code, link and preview
Letters appear in your dashboard and via the API: GET /api/v1/mailboxes/{id}/letters returns id, from, subject, body, text and received_at. The body field holds the original letter (HTML when available), text the same as plain text. Read the code from text; the confirmation link can usually be extracted from the HTML in body. Not always, though: when the full HTML is not available, body carries a text preview — the start of the letter without markup or links. The response has no separate list of links, and attachments are not supported.
So the test must recognise the preview case: no markup and no link in body is not an app failure but a "cannot verify on this letter" status. Recheck such letters, and the layout, on control mailboxes with your users' email providers.
Test case 1: the correct code
Register a test user with the mailbox address and request a code. There is no webhook for new letters, so the test polls the API. Store the id of the last processed letter and pass it as after_id to get only letters saved after it. Extract the code from text, check from and subject, enter the code and assert the account is verified. Also check that a wrong code is rejected with a clear error.
For link confirmation, extract the link from the HTML in body, open it, assert the account is verified, and check that reopening it behaves per spec. If a preview without a link arrives, mark the check "cannot verify on this letter" and repeat it on a control mailbox.
Fit polling to the limits: 60 read requests per minute per key, up to 100 letters per page. The mailbox is checked in the background once a minute, and an API call adds a check no more often than once every 10 seconds.
Test case 2: the expired code
A code entered after the lifetime configured in your app must be rejected, with a clear message and a way to request a new one. To avoid waiting out the full lifetime each run, make it a staging setting and shorten it for tests. Check both sides: just before expiry (accepted) and just after (rejected).
Measure expiry from the issue time in your app's logs, not from received_at. received_at is when the letter was saved on our side after polling the mail server, not when the mail server accepted it; it is UTC, ISO 8601 with a "Z", to the second. Delivery plus the polling interval sit between issuance and received_at, so give boundary checks a margin larger than that interval.
Test case 3: a code superseded by a resend
Request a code, then request it again — two letters arrive. Your spec defines which code works after a resend: in some apps the new code cancels the old one, in others both stay valid until expiry. Test both: the old code behaves strictly per spec, the new one is accepted. For link-based confirmation, test the same rule on the link from the old letter.
The trap is letter order. Two letters sent close together may arrive out of order or land in one polling pass with near-identical received_at, so "the latest letter" is an unreliable signal. Match the letter's code against the one your app considers active, via the staging log or a subject marker such as the attempt number.
Frequently Asked Questions
Can I test a confirmation link with a rented mailbox?
Usually yes, if the letter arrived with HTML: extract the link from body. Not always, though: without full HTML, body carries a text preview with no markup or links, so mark such a letter "cannot verify" and repeat the check on a control mailbox.
How precisely does received_at reflect delivery time?
To within the polling interval. received_at is the time the letter was saved on our side, in UTC to the second — not the time the mail server accepted it.
What happens to letters after the rental ends?
Letters from the rental period stay available through the API, while the dashboard shows the feed only for active rentals. New letters are not accepted after the end. For longer-lived test accounts, turn on auto-renewal — it charges one hour before the term ends.
Order a full mailbox in the mailbox shop ("Full mailbox" tab, sign-in required); the API documentation describes requests and fields. To check a series against your sending log, see How to Test Email Delivery.