Start with the thing most guides to this topic do not mention. If you are sending one-time passcodes by email, the US standard for digital authentication says you are not performing authentication.
NIST SP 800-63B-4 is direct about it: “Email SHALL NOT be used for out-of-band authentication.”
That is not the end of the article, because the same section grants an exemption that almost nobody quotes — and it is the exemption that most email OTP implementations actually live under. Knowing which side of that line you are on decides your token length, your expiry window, your rate limiting and your provider requirements.
Quick Answer
| What you are building | NIST position | What follows |
|---|---|---|
| Verifying someone owns an email address | Permitted — explicitly exempt | Build it properly; the requirements below are good practice |
| Account recovery codes | Permitted — explicitly exempt | Same |
| Email code as a second factor at login | Prohibited as out-of-band authentication | Use an authenticator app or passkey for the second factor |
| Email code as the only login step | Prohibited for the same reason | This is the pattern to move away from |
Most products sending OTP emails are doing address verification or recovery, which is permitted. The problem is that they frequently build it as though it were authentication, or build it as though none of the requirements applied.
What NIST Actually Says

The current edition is NIST SP 800-63B-4, published July 2025, which superseded the long-cited 2017 edition on 1 August 2025. If a guide you are reading cites section 5.1.3.1, it is working from the withdrawn version — the current numbering is 3.1.3.x.
The prohibition, from section 3.1.3.1: “Email SHALL NOT be used for out-of-band authentication because it may be vulnerable to:” — and the listed risks are access with only a password, interception in transit or at mail servers, and reroutes via DNS spoofing.
The exemption, from a note in the same section: codes sent to validate an email address, or issued as recovery codes, “are not authentication processes and not affected by the above prohibition.”
That distinction is the whole design decision, so it is worth being concrete about where the line falls:
| Flow | Is it authentication? |
|---|---|
| New signup — confirm the address is real and theirs | No. Address validation |
| Changing the email on an account — confirm the new address | No. Address validation |
| Lost access, no second factor available — recovery code | No. Recovery |
| Password reset link or code | Recovery, but treat it as the highest-value mail you send |
| Code emailed at every login as step two | Yes — and prohibited |
| Code emailed instead of a password | Yes — and prohibited |
Note
NIST’s own FAQ still answers this question by quoting the 2017 edition — “NIST SP 800-63B does not allow the use of email as a channel for single or multi-factor authentication processes”, citing section 5.1.3.1. The substance is unchanged in the current edition, but the section number is not, and the FAQ does not mention the confirmation-code exemption at all. If you are citing this to a security reviewer or an auditor, cite SP 800-63B-4 section 3.1.3.1 directly rather than the FAQ, and quote the exemption note alongside the prohibition. A reviewer who has only read the prohibition may believe your signup verification flow is non-compliant when the standard explicitly says it is out of scope.
The Six Requirements, With Section Numbers
Whichever side of the line you are on, these are the verifier obligations the standard sets for out-of-band secrets. They are the right baseline for a verification or recovery code too, and they are the specification an auditor will check against.
| Requirement | What the standard says | Section |
|---|---|---|
| Length | “at least six decimal digits (or equivalent) in length” | 3.1.3.2 |
| Generation | Generated with an approved random bit generator | 3.2.12 |
| Expiry | “the authentication SHALL be considered invalid unless completed within 10 minutes” | 3.1.3.2 |
| Single use | “Verifiers SHALL accept a given authentication secret as valid only once during the validity period” | 3.1.3.2 |
| Rate limiting | Required for any secret under 64 bits — which a six-digit code is | 3.1.3.2 |
| Failure cap | Limit consecutive failures “to no more than 100 by disabling that authenticator” | 3.2.2 |
Two of those rows deserve more than a table cell, because they are where implementations go wrong.
Six digits is one in a million, and that is not the defence
A six-digit code has a million possibilities, which a script can work through quickly. The standard does not close that gap by demanding longer codes — it closes it with the attempt limit. Six digits plus strict throttling is secure; six digits with unlimited attempts is a formality.
The 100-failure cap is the maximum the standard permits, not a target. Five attempts against a six-digit code gives an attacker five chances in a million. There is no usability cost to being far stricter than 100.
The resend trap: generating a new code must not reset the counter
This is the single most commonly botched detail, and the standard is explicit: when the verifier issues a new secret, the failed-attempt count does not reset.
# The bug almost every first implementation has
POST /otp/verify { code: "000000" } -> fail, attempts = 1
POST /otp/verify { code: "000001" } -> fail, attempts = 2
POST /otp/verify { code: "000002" } -> fail, attempts = 3
POST /otp/resend -> new code issued
attempts = 0 # WRONG
# An attacker now has unlimited guesses: burn three, request a
# resend, repeat. The throttle never engages.
# Correct: the counter belongs to the ACCOUNT, not to the code.
attempts_key = f"otp_failures:{account_id}" # not :{code_id}
# Increment on every failed verification.
# Reset ONLY on successful verification, or after a
# cool-down window has fully elapsed.
# Issuing a new code changes nothing about this counter.
If you take one implementation detail from this article, take that one. It is a complete bypass of your rate limiting, it passes every functional test, and it is invisible until someone attacks you.
Quick Fix
Auditing Your OTP Implementation in Ten Minutes
- Request a resend after two failed attempts — if the counter resets, your throttle is bypassable
- Submit a code that already succeeded — it must be rejected; single use means single use
- Submit a code at eleven minutes — it must be rejected, per the 10-minute window
- Confirm codes come from a CSPRNG, not from a timestamp, a sequence or a language’s default random
- Check the failure counter is keyed to the account, not to the individual code record
- Request codes for an address that does not exist — the response and timing must be identical to one that does
The Latency Budget Is Smaller Than You Think

Here is where the verified 10-minute window turns into an engineering requirement rather than a preference.
That window covers the entire flow — not the time from when the mail arrives, but from when the code is generated. Everything in between spends it:
| Stage | Typical | Bad day |
|---|---|---|
| Generate and store the code | Milliseconds | Milliseconds |
| Hand to your provider | Under a second | Seconds, if the API is queued |
| Provider accepts and transmits | Seconds | Minutes, if throttled or deferred |
| Receiving server accepts and files it | Seconds | Minutes, with greylisting |
| User notices the mail | Seconds to a minute | Several minutes |
| User reads and types six digits | 15 to 30 seconds | A minute |
On a good path the user has most of the window. With a deferred send or a greylisting receiver, delivery alone can consume several minutes — and the user, who has no idea a clock is running, comes back to a code that has expired. They request another. That one is slow too.
Which produces the failure mode every support team recognises: a user stuck in a resend loop, each code expiring before they use it. It reads to them as a broken product, and it is caused entirely by delivery latency against a fixed window.
PhotonConsole records an accept timestamp and a delivery timestamp separately, so the gap between them is a number you can alert on rather than infer. Three consequences for how you build:
- Show the expiry to the user. “This code expires at 14:32” lets them decide whether to use it or request a new one. A silent clock guarantees confusion.
- Measure time-to-delivery, not just delivery. A code delivered in 40 seconds and one delivered in 9 minutes are both “delivered” and only one is useful. This is why your own event store matters more than a provider dashboard.
- Do not send OTP through a path that queues. As we covered in Mailjet alternatives, some providers queue mail that exceeds a cap rather than rejecting it — which for an OTP is worse than failing, because your application believes it succeeded.
Common Mistake
Treating a successful API response as a delivered code. For most mail, the gap between accepted and delivered is a reporting nuance. For an OTP it is the entire product: the user is sitting on a verification screen right now, and your application has told them to check an inbox that may not receive anything for four minutes, or at all. This is why OTP is the least forgiving email type — every other kind of mail tolerates delay. A newsletter arriving an hour late is fine. A receipt arriving tomorrow is acceptable. A passcode arriving after its ten-minute window has closed is not a late email, it is a failed login, and the user experiences it as your product being broken rather than your email being slow. Confirm delivery from webhook events and alert on the delay, not only on errors.
Why OTP Is the Least Forgiving Email You Send
Authentication failures are one of the most common causes of email delivery problems, and for OTP the consequence is immediate rather than statistical. Three properties make this mail different.
It is time-bound by design. Everything else you send is useful whenever it arrives. A passcode is useful for ten minutes.
The user is actively waiting. Nobody refreshes their inbox for a newsletter. For a verification code they refresh every few seconds, which means every second of delay is experienced rather than merely measured.
Spam filtering is indistinguishable from an outage. If a receipt lands in spam, the customer finds it later. If a passcode lands in spam, the user cannot complete the action and contacts support — or abandons signup, which you will never hear about.
That last point is the deliverability argument, and it is why the separation question matters more here than anywhere else.
Never Send OTP From a Marketing Identity
If your passcodes leave from the same domain and reputation as your campaigns, your newsletter’s complaint rate gets a vote on whether people can log in.
This is the problem we documented from two directions already. On a marketing-first platform, separating the two is achievable but often priced out of reach — Brevo requires two dedicated IPs each needing over 100,000 emails a month to stay warm, which most senders cannot feed. Some providers enforce the separation for you: Postmark keeps the two on separate IP pools as a platform property, and ZeptoMail will not carry marketing mail at all.
The cheap version works everywhere and has no volume floor: send authentication mail from its own subdomain, with its own SPF and DKIM records.
# Separate identity for mail that must arrive
auth.yourdomain.com OTP, password resets, security alerts
news.yourdomain.com campaigns, product announcements
# Each publishes its own SPF and DKIM. A bad campaign week
# cannot touch the reputation that carries your login codes.
#
# Count your SPF lookups before adding an include: exceeding
# the ten-term limit returns permerror and fails BOTH.
PhotonConsole authenticates each subdomain independently, so auth. and news. are two sets of DNS records rather than two accounts or two bills. Our guide to the SPF ten-lookup limit covers that last trap, and Google and Yahoo’s sender requirements apply to the auth subdomain like any other — score an end-to-end send from it with Mail Tester and confirm the records resolve with MXToolbox before any real passcode flows. Google asks senders to keep user-reported spam below 0.1% and never reach 0.3% — and a transactional-only subdomain should sit far below that, because nobody marks a passcode they requested as spam.
If OTP mail is generating complaints, something else is wrong: you are sending codes nobody asked for, which is the abuse case below.
Abuse Prevention: Two Attacks Specific to OTP Email
Address enumeration. If your verification endpoint behaves differently for a registered address than an unregistered one — a different message, a different status code, or merely a faster response — it becomes a tool for confirming which email addresses have accounts with you. Responses must be identical in content and in timing.
Mail bombing. An unthrottled “send me a code” endpoint lets anyone direct your mail at a third party, repeatedly. Beyond harming that person, it damages your own sending reputation, and complaints against an auth subdomain are the ones you can least afford.
Quick Fix
Choosing a Provider for OTP Specifically
- Does it reject or queue at a limit? For OTP, a loud failure you can retry beats a silent success
- Is the cap daily or monthly? Signup volume is driven by your users, not your calendar
- Can you authenticate a subdomain independently? This is how you separate auth from marketing for free
- What does the webhook report, and how fast? You need delivery timing, not just delivery
- Is there a burst allowance? A launch or a campaign landing page creates a signup spike
- How long are logs retained? “I never got the code” disputes arrive after the window closes
- Is API key scope and IP allowlisting available? See our API key security guide
On the first point: a provider that defers mail under load is poorly matched to this use case regardless of its other merits. PhotonConsole rejects rather than queues when a limit is reached, authenticates each subdomain independently, and bills flat per thousand — the relay page and transactional email page cover the setup, and pricing has no monthly tier to outgrow mid-launch.
Being straight about the alternatives: several providers do this well, and the comparison page sets them side by side. The requirements above matter more than the vendor.
Pro Tips
- Know whether you are doing authentication or verification. NIST permits one and prohibits the other.
- Key the failure counter to the account, not the code. Resend must not reset it.
- Six digits from a CSPRNG, not from a timestamp. Predictable codes defeat every other control.
- Show the expiry time in the email and on screen. A silent clock creates resend loops.
- Measure time-to-delivery, not delivery. Forty seconds and nine minutes are both “delivered”.
- Send auth mail from its own subdomain. Free, no volume floor, and it protects logins from campaigns.
- Make enumeration responses identical, including timing. A faster “no such account” is still a disclosure.
- Be far stricter than 100 failures. That is the standard’s ceiling, not its recommendation.
- If email is your second factor, plan to replace it. An authenticator app or passkey is the compliant path.
Related Reading
- Brevo alternatives — what separating auth from marketing costs on a marketing platform
- Mailjet alternatives — why a provider that queues at its cap is wrong for OTP
- Resend alternatives — rate limits, burst behaviour and log retention compared
- Transactional email webhooks explained — building the delivery-timing measurement
- SPF, DKIM and DMARC explained simply — authenticating an auth subdomain
- Reducing email bounce rate — protecting a new sending identity
Frequently Asked Questions
Does NIST allow OTP codes sent by email?
Not for authentication. SP 800-63B-4 section 3.1.3.1 states “Email SHALL NOT be used for out-of-band authentication.” But codes sent to validate an email address, or issued as recovery codes, “are not authentication processes and not affected by the above prohibition.”
So is my signup verification email non-compliant?
No. Confirming that someone owns an address is explicitly exempt from the prohibition. The prohibition applies to using an emailed code as a login factor.
How long should an OTP be valid?
The standard requires the authentication to be invalid unless completed within 10 minutes, and that window covers generation, delivery and the user’s typing — not just the time after the mail arrives.
How many digits should an OTP have?
At least six decimal digits or equivalent, generated with an approved random bit generator. Security comes from the attempt limit rather than the length.
How many failed attempts should I allow?
The standard caps consecutive failures at no more than 100 before disabling the authenticator. That is the ceiling, not a target — five is defensible and costs users nothing.
Does requesting a new code reset the attempt counter?
It must not. The standard states that generating a new secret does not reset the count. Key the counter to the account rather than to the code record, or your rate limiting is bypassable.
Can an OTP be used twice?
No. Verifiers must accept a given secret as valid only once during its validity period.
Why do my OTP emails arrive too late to use?
Because the 10-minute window starts at generation, not at delivery. A deferred send or a greylisting receiver can consume several minutes, leaving the user with an expired code and no explanation.
Should OTP emails come from a different domain than marketing?
From a different subdomain, yes. It costs nothing, has no volume floor, and stops your campaign complaint rate affecting whether people can log in.
What should replace email as a second factor?
An authenticator app or a passkey. Both prove possession of a device, which is what the out-of-band requirement exists to establish.
Conclusion
OTP email sits in an awkward position that most writing on the subject skips past. The authoritative standard prohibits email as an authentication channel in plain language, and in the same section exempts exactly the two things most products are actually doing with it — confirming an address, and recovering an account.
So the first question is not which provider to use. It is which flow you are building, because if an emailed code is your second factor at login, no amount of delivery engineering makes that compliant and the fix is an authenticator app or a passkey.
For the permitted flows, the specification is concrete and short: at least six digits from an approved random generator, invalid after ten minutes, accepted once, rate limited because the secret is under 64 bits, and a failure counter that does not reset when a new code is issued. That last requirement is the one almost every first implementation gets wrong, it passes all your tests, and it is a complete bypass of the control it was supposed to enforce.
Then there is the part the standard does not cover, which is that ten minutes has to contain your delivery time as well as the user’s attention. A passcode that arrives in four minutes has not been delivered late — it has been delivered into a window that is nearly closed, and the user reads that as a broken product. Send auth mail from its own subdomain, measure time-to-delivery rather than delivery, and choose a relay that rejects rather than defers when it hits a limit. For every other kind of email, a few minutes is a rounding error. For this one, it is the product.
