{"id":629,"date":"2026-12-05T01:00:37","date_gmt":"2026-12-05T06:30:37","guid":{"rendered":"https:\/\/photonconsole.com\/blog\/?p=629"},"modified":"2026-12-05T09:00:59","modified_gmt":"2026-12-05T14:30:59","slug":"otp-email-service-delivery-latency-and-security","status":"publish","type":"post","link":"https:\/\/photonconsole.com\/blog\/otp-email-service-delivery-latency-and-security\/","title":{"rendered":"OTP Email Service: Delivery, Latency and Security"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NIST SP 800-63B-4 is direct about it: <strong>&#8220;Email SHALL NOT be used for out-of-band authentication.&#8221;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is not the end of the article, because the same section grants an exemption that almost nobody quotes \u2014 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Answer<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>What you are building<\/th><th>NIST position<\/th><th>What follows<\/th><\/tr><\/thead><tbody><tr><td>Verifying someone owns an email address<\/td><td><strong>Permitted<\/strong> \u2014 explicitly exempt<\/td><td>Build it properly; the requirements below are good practice<\/td><\/tr><tr><td>Account recovery codes<\/td><td><strong>Permitted<\/strong> \u2014 explicitly exempt<\/td><td>Same<\/td><\/tr><tr><td>Email code as a second factor at login<\/td><td><strong>Prohibited<\/strong> as out-of-band authentication<\/td><td>Use an authenticator app or passkey for the second factor<\/td><\/tr><tr><td>Email code as the only login step<\/td><td><strong>Prohibited<\/strong> for the same reason<\/td><td>This is the pattern to move away from<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What NIST Actually Says<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Prohibited-vs-Exempt-Email-Codes-1024x683.png\" alt=\"The NIST prohibition on email for out-of-band authentication with its three listed risks, beside the exemption for address-validation and recovery codes, both from section 3.1.3.1\" class=\"wp-image-631\" style=\"aspect-ratio:1.7777777777777777;width:1200px;height:auto\" srcset=\"https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Prohibited-vs-Exempt-Email-Codes-1024x683.png 1024w, https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Prohibited-vs-Exempt-Email-Codes-300x200.png 300w, https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Prohibited-vs-Exempt-Email-Codes-768x512.png 768w, https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Prohibited-vs-Exempt-Email-Codes.png 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">One prohibition, one exemption. Which side you are on decides the design.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The current edition is <a href=\"https:\/\/nvlpubs.nist.gov\/nistpubs\/SpecialPublications\/NIST.SP.800-63B-4.pdf\" target=\"_blank\" rel=\"noopener\">NIST SP 800-63B-4<\/a>, 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 \u2014 the current numbering is 3.1.3.x.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The prohibition<\/strong>, from <a href=\"https:\/\/pages.nist.gov\/800-63-4\/sp800-63b\/authenticators\" target=\"_blank\" rel=\"noopener\">section 3.1.3.1<\/a>: &#8220;Email SHALL NOT be used for out-of-band authentication because it may be vulnerable to:&#8221; \u2014 and the listed risks are access with only a password, interception in transit or at mail servers, and reroutes via DNS spoofing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The exemption<\/strong>, from a note in the same section: codes sent to validate an email address, or issued as recovery codes, &#8220;are not authentication processes and not affected by the above prohibition.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That distinction is the whole design decision, so it is worth being concrete about where the line falls:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Flow<\/th><th>Is it authentication?<\/th><\/tr><\/thead><tbody><tr><td>New signup \u2014 confirm the address is real and theirs<\/td><td>No. Address validation<\/td><\/tr><tr><td>Changing the email on an account \u2014 confirm the new address<\/td><td>No. Address validation<\/td><\/tr><tr><td>Lost access, no second factor available \u2014 recovery code<\/td><td>No. Recovery<\/td><\/tr><tr><td>Password reset link or code<\/td><td>Recovery, but treat it as the highest-value mail you send<\/td><\/tr><tr><td>Code emailed at every login as step two<\/td><td><strong>Yes \u2014 and prohibited<\/strong><\/td><\/tr><tr><td>Code emailed instead of a password<\/td><td><strong>Yes \u2014 and prohibited<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Note<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pages.nist.gov\/800-63-FAQ\/\" target=\"_blank\" rel=\"noopener\">NIST&#8217;s own FAQ<\/a> still answers this question by quoting the 2017 edition \u2014 &#8220;NIST SP 800-63B does not allow the use of email as a channel for single or multi-factor authentication processes&#8221;, 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Six Requirements, With Section Numbers<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Requirement<\/th><th>What the standard says<\/th><th>Section<\/th><\/tr><\/thead><tbody><tr><td><strong>Length<\/strong><\/td><td>&#8220;at least six decimal digits (or equivalent) in length&#8221;<\/td><td>3.1.3.2<\/td><\/tr><tr><td><strong>Generation<\/strong><\/td><td>Generated with an approved random bit generator<\/td><td>3.2.12<\/td><\/tr><tr><td><strong>Expiry<\/strong><\/td><td>&#8220;the authentication SHALL be considered invalid unless completed within 10 minutes&#8221;<\/td><td>3.1.3.2<\/td><\/tr><tr><td><strong>Single use<\/strong><\/td><td>&#8220;Verifiers SHALL accept a given authentication secret as valid only once during the validity period&#8221;<\/td><td>3.1.3.2<\/td><\/tr><tr><td><strong>Rate limiting<\/strong><\/td><td>Required for any secret under 64 bits \u2014 which a six-digit code is<\/td><td>3.1.3.2<\/td><\/tr><tr><td><strong>Failure cap<\/strong><\/td><td>Limit consecutive failures &#8220;to no more than 100 by disabling that authenticator&#8221;<\/td><td>3.2.2<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Two of those rows deserve more than a table cell, because they are where implementations go wrong.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Six digits is one in a million, and that is not the defence<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u2014 it closes it with the attempt limit. Six digits plus strict throttling is secure; six digits with unlimited attempts is a formality.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The 100-failure cap is the <em>maximum<\/em> 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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The resend trap: generating a new code must not reset the counter<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This is the single most commonly botched detail, and the standard is explicit: when the verifier issues a new secret, <strong>the failed-attempt count does not reset.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># The bug almost every first implementation has\n\n  POST \/otp\/verify   { code: \"000000\" }  -&gt; fail, attempts = 1\n  POST \/otp\/verify   { code: \"000001\" }  -&gt; fail, attempts = 2\n  POST \/otp\/verify   { code: \"000002\" }  -&gt; fail, attempts = 3\n  POST \/otp\/resend                       -&gt; new code issued\n                                            attempts = 0   # WRONG\n\n# An attacker now has unlimited guesses: burn three, request a\n# resend, repeat. The throttle never engages.\n\n# Correct: the counter belongs to the ACCOUNT, not to the code.\n\n  attempts_key = f\"otp_failures:{account_id}\"   # not :{code_id}\n\n  # Increment on every failed verification.\n  # Reset ONLY on successful verification, or after a\n  # cool-down window has fully elapsed.\n  # Issuing a new code changes nothing about this counter.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Quick Fix<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Auditing Your OTP Implementation in Ten Minutes<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Request a resend after two failed attempts<\/strong> \u2014 if the counter resets, your throttle is bypassable<\/li>\n\n\n\n<li><strong>Submit a code that already succeeded<\/strong> \u2014 it must be rejected; single use means single use<\/li>\n\n\n\n<li><strong>Submit a code at eleven minutes<\/strong> \u2014 it must be rejected, per the 10-minute window<\/li>\n\n\n\n<li><strong>Confirm codes come from a CSPRNG<\/strong>, not from a timestamp, a sequence or a language&#8217;s default random<\/li>\n\n\n\n<li><strong>Check the failure counter is keyed to the account<\/strong>, not to the individual code record<\/li>\n\n\n\n<li><strong>Request codes for an address that does not exist<\/strong> \u2014 the response and timing must be identical to one that does<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The Latency Budget Is Smaller Than You Think<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Generation-Starts-the-Clock-1024x683.png\" alt=\"Two ten-minute OTP windows compared, one with fast delivery leaving a large usable window and one where deferred delivery consumes most of it and the code expires, causing a resend loop\" class=\"wp-image-632\" style=\"aspect-ratio:1.7777777777777777;width:1200px;height:auto\" srcset=\"https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Generation-Starts-the-Clock-1024x683.png 1024w, https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Generation-Starts-the-Clock-300x200.png 300w, https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Generation-Starts-the-Clock-768x512.png 768w, https:\/\/photonconsole.com\/blog\/wp-content\/uploads\/2026\/12\/Generation-Starts-the-Clock.png 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Ten minutes is the whole budget, and delivery spends it before the user sees anything.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Here is where the verified 10-minute window turns into an engineering requirement rather than a preference.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That window covers the <em>entire<\/em> flow \u2014 not the time from when the mail arrives, but from when the code is generated. Everything in between spends it:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Stage<\/th><th>Typical<\/th><th>Bad day<\/th><\/tr><\/thead><tbody><tr><td>Generate and store the code<\/td><td>Milliseconds<\/td><td>Milliseconds<\/td><\/tr><tr><td>Hand to your provider<\/td><td>Under a second<\/td><td>Seconds, if the API is queued<\/td><\/tr><tr><td>Provider accepts and transmits<\/td><td>Seconds<\/td><td>Minutes, if throttled or deferred<\/td><\/tr><tr><td>Receiving server accepts and files it<\/td><td>Seconds<\/td><td>Minutes, with greylisting<\/td><\/tr><tr><td>User notices the mail<\/td><td>Seconds to a minute<\/td><td>Several minutes<\/td><\/tr><tr><td>User reads and types six digits<\/td><td>15 to 30 seconds<\/td><td>A minute<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u2014 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Which produces the failure mode every support team recognises: <strong>a user stuck in a resend loop, each code expiring before they use it.<\/strong> It reads to them as a broken product, and it is caused entirely by delivery latency against a fixed window.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Show the expiry to the user.<\/strong> &#8220;This code expires at 14:32&#8221; lets them decide whether to use it or request a new one. A silent clock guarantees confusion.<\/li>\n\n\n\n<li><strong>Measure time-to-delivery, not just delivery.<\/strong> A code delivered in 40 seconds and one delivered in 9 minutes are both &#8220;delivered&#8221; and only one is useful. This is why your own event store matters more than a provider dashboard.<\/li>\n\n\n\n<li><strong>Do not send OTP through a path that queues.<\/strong> As we covered in <a href=\"https:\/\/photonconsole.com\/blog\/mailjet-alternatives\/\">Mailjet alternatives<\/a>, some providers queue mail that exceeds a cap rather than rejecting it \u2014 which for an OTP is worse than failing, because your application believes it succeeded.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Common Mistake<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u2014 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why OTP Is the Least Forgiving Email You Send<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>It is time-bound by design.<\/strong> Everything else you send is useful whenever it arrives. A passcode is useful for ten minutes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The user is actively waiting.<\/strong> 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Spam filtering is indistinguishable from an outage.<\/strong> 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 \u2014 or abandons signup, which you will never hear about.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That last point is the deliverability argument, and it is why the separation question matters more here than anywhere else.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Never Send OTP From a Marketing Identity<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your passcodes leave from the same domain and reputation as your campaigns, your newsletter&#8217;s complaint rate gets a vote on whether people can log in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u2014 <a href=\"https:\/\/photonconsole.com\/blog\/brevo-alternatives\/\">Brevo requires two dedicated IPs<\/a> each needing over 100,000 emails a month to stay warm, which most senders cannot feed. Some providers enforce the separation for you: <a href=\"https:\/\/photonconsole.com\/blog\/migrate-from-postmark\/\">Postmark keeps the two on separate IP pools<\/a> as a platform property, and <a href=\"https:\/\/photonconsole.com\/blog\/zeptomail-alternatives\/\">ZeptoMail will not carry marketing mail at all<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The cheap version works everywhere and has no volume floor: <strong>send authentication mail from its own subdomain<\/strong>, with its own SPF and DKIM records.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Separate identity for mail that must arrive\n\n  auth.yourdomain.com     OTP, password resets, security alerts\n  news.yourdomain.com     campaigns, product announcements\n\n# Each publishes its own SPF and DKIM. A bad campaign week\n# cannot touch the reputation that carries your login codes.\n#\n# Count your SPF lookups before adding an include: exceeding\n# the ten-term limit returns permerror and fails BOTH.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">PhotonConsole authenticates each subdomain independently, so <code>auth.<\/code> and <code>news.<\/code> are two sets of DNS records rather than two accounts or two bills. Our guide to the <a href=\"https:\/\/www.photonconsole.com\/spf-10-dns-lookup-limit-explained.php\">SPF ten-lookup limit<\/a> covers that last trap, and <a href=\"https:\/\/www.photonconsole.com\/google-yahoo-sender-requirements.php\">Google and Yahoo&#8217;s sender requirements<\/a> apply to the auth subdomain like any other \u2014 score an end-to-end send from it with <a href=\"https:\/\/www.mail-tester.com\/\" target=\"_blank\" rel=\"noopener\">Mail Tester<\/a> and confirm the records resolve with <a href=\"https:\/\/mxtoolbox.com\/\" target=\"_blank\" rel=\"noopener\">MXToolbox<\/a> before any real passcode flows. <a href=\"https:\/\/support.google.com\/a\/answer\/14229414\" target=\"_blank\" rel=\"noopener\">Google asks senders<\/a> to keep user-reported spam below 0.1% and never reach 0.3% \u2014 and a transactional-only subdomain should sit far below that, because nobody marks a passcode they requested as spam.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If OTP mail is generating complaints, something else is wrong: you are sending codes nobody asked for, which is the abuse case below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Abuse Prevention: Two Attacks Specific to OTP Email<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Address enumeration.<\/strong> If your verification endpoint behaves differently for a registered address than an unregistered one \u2014 a different message, a different status code, or merely a faster response \u2014 it becomes a tool for confirming which email addresses have accounts with you. Responses must be identical in content and in timing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mail bombing.<\/strong> An unthrottled &#8220;send me a code&#8221; 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Quick Fix<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Choosing a Provider for OTP Specifically<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Does it reject or queue at a limit?<\/strong> For OTP, a loud failure you can retry beats a silent success<\/li>\n\n\n\n<li><strong>Is the cap daily or monthly?<\/strong> Signup volume is driven by your users, not your calendar<\/li>\n\n\n\n<li><strong>Can you authenticate a subdomain independently?<\/strong> This is how you separate auth from marketing for free<\/li>\n\n\n\n<li><strong>What does the webhook report, and how fast?<\/strong> You need delivery timing, not just delivery<\/li>\n\n\n\n<li><strong>Is there a burst allowance?<\/strong> A launch or a campaign landing page creates a signup spike<\/li>\n\n\n\n<li><strong>How long are logs retained?<\/strong> &#8220;I never got the code&#8221; disputes arrive after the window closes<\/li>\n\n\n\n<li><strong>Is API key scope and IP allowlisting available?<\/strong> See our <a href=\"https:\/\/www.photonconsole.com\/smtp-api-key-security-ip-whitelisting.php\">API key security guide<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">On the first point: a provider that defers mail under load is poorly matched to this use case regardless of its other merits. <a href=\"https:\/\/www.photonconsole.com\/\">PhotonConsole<\/a> rejects rather than queues when a limit is reached, authenticates each subdomain independently, and bills flat per thousand \u2014 the <a href=\"https:\/\/www.photonconsole.com\/relay.php\">relay page<\/a> and <a href=\"https:\/\/www.photonconsole.com\/transactional-emails.php\">transactional email page<\/a> cover the setup, and <a href=\"https:\/\/www.photonconsole.com\/pricing.php\">pricing<\/a> has no monthly tier to outgrow mid-launch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Being straight about the alternatives: several providers do this well, and the <a href=\"https:\/\/www.photonconsole.com\/compare.php\">comparison page<\/a> sets them side by side. The requirements above matter more than the vendor.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pro Tips<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Know whether you are doing authentication or verification.<\/strong> NIST permits one and prohibits the other.<\/li>\n\n\n\n<li><strong>Key the failure counter to the account, not the code.<\/strong> Resend must not reset it.<\/li>\n\n\n\n<li><strong>Six digits from a CSPRNG, not from a timestamp.<\/strong> Predictable codes defeat every other control.<\/li>\n\n\n\n<li><strong>Show the expiry time in the email and on screen.<\/strong> A silent clock creates resend loops.<\/li>\n\n\n\n<li><strong>Measure time-to-delivery, not delivery.<\/strong> Forty seconds and nine minutes are both &#8220;delivered&#8221;.<\/li>\n\n\n\n<li><strong>Send auth mail from its own subdomain.<\/strong> Free, no volume floor, and it protects logins from campaigns.<\/li>\n\n\n\n<li><strong>Make enumeration responses identical, including timing.<\/strong> A faster &#8220;no such account&#8221; is still a disclosure.<\/li>\n\n\n\n<li><strong>Be far stricter than 100 failures.<\/strong> That is the standard&#8217;s ceiling, not its recommendation.<\/li>\n\n\n\n<li><strong>If email is your second factor, plan to replace it.<\/strong> An authenticator app or passkey is the compliant path.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Related Reading<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/photonconsole.com\/blog\/brevo-alternatives\/\">Brevo alternatives<\/a> \u2014 what separating auth from marketing costs on a marketing platform<\/li>\n\n\n\n<li><a href=\"https:\/\/photonconsole.com\/blog\/mailjet-alternatives\/\">Mailjet alternatives<\/a> \u2014 why a provider that queues at its cap is wrong for OTP<\/li>\n\n\n\n<li><a href=\"https:\/\/photonconsole.com\/blog\/resend-alternatives\/\">Resend alternatives<\/a> \u2014 rate limits, burst behaviour and log retention compared<\/li>\n\n\n\n<li><a href=\"https:\/\/photonconsole.com\/blog\/transactional-email-webhooks-explained-the-complete-engineering-guide-for-reliable-email-event-processing\/\">Transactional email webhooks explained<\/a> \u2014 building the delivery-timing measurement<\/li>\n\n\n\n<li><a href=\"https:\/\/photonconsole.com\/blog\/spf-dkim-dmarc-explained-simply\/\">SPF, DKIM and DMARC explained simply<\/a> \u2014 authenticating an auth subdomain<\/li>\n\n\n\n<li><a href=\"https:\/\/photonconsole.com\/blog\/how-to-reduce-email-bounce-rate-for-saas-applications-a-production-infrastructure-guide\/\">Reducing email bounce rate<\/a> \u2014 protecting a new sending identity<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Does NIST allow OTP codes sent by email?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Not for authentication. SP 800-63B-4 section 3.1.3.1 states &#8220;Email SHALL NOT be used for out-of-band authentication.&#8221; But codes sent to validate an email address, or issued as recovery codes, &#8220;are not authentication processes and not affected by the above prohibition.&#8221;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">So is my signup verification email non-compliant?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How long should an OTP be valid?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The standard requires the authentication to be invalid unless completed within 10 minutes, and that window covers generation, delivery and the user&#8217;s typing \u2014 not just the time after the mail arrives.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How many digits should an OTP have?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">At least six decimal digits or equivalent, generated with an approved random bit generator. Security comes from the attempt limit rather than the length.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How many failed attempts should I allow?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The standard caps consecutive failures at no more than 100 before disabling the authenticator. That is the ceiling, not a target \u2014 five is defensible and costs users nothing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does requesting a new code reset the attempt counter?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can an OTP be used twice?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Verifiers must accept a given secret as valid only once during its validity period.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why do my OTP emails arrive too late to use?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Should OTP emails come from a different domain than marketing?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">From a different subdomain, yes. It costs nothing, has no volume floor, and stops your campaign complaint rate affecting whether people can log in.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What should replace email as a second factor?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An authenticator app or a passkey. Both prove possession of a device, which is what the out-of-band requirement exists to establish.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u2014 confirming an address, and recovering an account.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 <strong>does not reset when a new code is issued<\/strong>. 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;s attention. A passcode that arrives in four minutes has not been delivered late \u2014 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 <a href=\"https:\/\/www.photonconsole.com\/relay.php\">relay that rejects rather than defers<\/a> 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Read More<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.photonconsole.com\/transactional-emails.php\">Transactional Email Delivery<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.photonconsole.com\/smtp-api-key-security-ip-whitelisting.php\">API Key Security and IP Allowlisting<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.photonconsole.com\/google-yahoo-sender-requirements.php\">Google and Yahoo Sender Requirements<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.photonconsole.com\/spf-10-dns-lookup-limit-explained.php\">The SPF 10-Lookup Limit Explained<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.photonconsole.com\/why-emails-go-to-spam-in-gmail.php\">Why Emails Go to Spam in Gmail<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.photonconsole.com\/smtp-relay-api.php\">SMTP Relay API Documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.photonconsole.com\/relay.php\">PhotonRelay: SMTP Relay Service<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.photonconsole.com\/pricing.php\">PhotonConsole Pricing<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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: &#8220;Email SHALL NOT be used for out-of-band authentication.&#8221; That is not the end of the article, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":630,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[627,625,626],"class_list":["post-629","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-smpt-relay-service","tag-and-the-ten-minute-budget","tag-nist-prohibits-emailed-codes-as-a-login-factor-and-exempts-verification-and-recovery-codes-the-six-requirements","tag-the-resend-trap"],"_links":{"self":[{"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/posts\/629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/comments?post=629"}],"version-history":[{"count":1,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/posts\/629\/revisions"}],"predecessor-version":[{"id":633,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/posts\/629\/revisions\/633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/media\/630"}],"wp:attachment":[{"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/media?parent=629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/categories?post=629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/photonconsole.com\/blog\/wp-json\/wp\/v2\/tags?post=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}