Blog

Sending OTPs: delays, retries and what users actually see

· 3 min read · Vaartix team

A user taps "Send code", switches to their inbox, and waits. Ten seconds feels long; a minute feels broken. Most OTP emails arrive quickly, but when one doesn't, the user doesn't know why, and often neither do you. This post covers what actually causes delays, what Vaartix shows you about them, and how to design your sign-in screen so a slow code doesn't become a lost user.

Where the time goes

An OTP email passes through several hands, and a delay can happen at any of them:

  1. Your app. If you send the email inside a slow request, or behind a busy job queue, the code is late before it's even sent.
  2. The sending service. Vaartix hands emails to Amazon SES at a steady pace. At busy moments an email can wait a few seconds in the queue; it's never dropped.
  3. The recipient's mail server. This is where most long delays happen. A receiving server can temporarily refuse email, for example because the mailbox is full or because it's limiting how fast it accepts mail from a sender. The email is retried automatically.
  4. The inbox itself. Some mail apps check for new mail only every few minutes, and filters can move a code into another folder or tab.

See exactly what happened

Every Vaartix email has a status and a timeline of events. A temporary refusal shows as delivery_delayed, with the receiving server's reply word for word. For example, a Yahoo reply like 421 4.7.0 [TSS04] … temporarily deferred … tells you Yahoo is slowing down mail from the sender for now. If retrying still fails when time runs out, a bounced event follows. You can see all of this in the dashboard, under the email's timeline, and receive it as email.delivery_delayed webhooks. See Statuses and events.

Design the screen for the slow case

  • Send the email first, then render the screen. Hand the email to Vaartix straight away, or queue it with high priority, rather than after other work.
  • Put the code in the subject. 482913 is your Acme login code shows in the notification, so many users never open the email at all.
  • Show a resend button after a short wait, not instantly. A user who taps "resend" three times in five seconds gets three codes and is confused about which one to use.
  • Accept the latest code, and keep codes valid long enough. Five to ten minutes is common.
  • Make retries safe. If your server retries a timed-out request, use an idempotency key based on the login attempt, so a network retry doesn't send two different codes.
  • Say where to look. "Check your spam folder" and the exact From address help more than you'd think.

Delays that aren't really delays

Sometimes "I never got the code" is something else:

  • A mistyped address. The email bounces. Listen for the email.bounced webhook and tell the user right away to check their address. Our post on bounces and complaints shows how.
  • The spam folder. Fix the cause with our checklist, Why your OTP emails land in spam.
  • A suppressed address. An address that bounced before is skipped, with a suppressed event saying why.

More good practice for login codes is on the OTP emails page.

Vaartix is a transactional email API built in India. It sends through Amazon SES in Mumbai, keeps your data in India and is priced in rupees. Anyone can sign up free, and the Free plan has every feature.

Sign up free