How to Send an OTP Email Verification Code in 2026
Send an OTP email verification code that is easy to copy in Gmail, keep it deliverable, and prepare for the Email Verification API and the OTP-Token header.
Email verification is still a slow step. Someone types an address, leaves your app, opens their inbox, finds the message, copies a code or clicks a link, and comes back. On 24 November 2026, Resend described three changes Google has been working on that try to shorten that path: a “Copy code” button in the Gmail app, an Email Verification API that can confirm an address without sending mail, and a new OTP-Token email header. Their longer write-up is The Future of Email Verification.
This article is for people who send an OTP email, a sign-up code, or a sign-in code today. It covers what is shipping, what is still a draft, and how to send a clear verification message from SendPanda. Two of the three changes are not things you can depend on in production yet. The email itself still has to work when they are absent.
Write the email so the code is easy to copy
Gmail on Android and iOS can show a “Copy code” pill under the subject in the inbox. Tapping it copies the one-time code, so the reader does not have to open the message and select the digits. 9to5Google reported the control on 19 September 2026 in Gmail for Android version 2026.09.07.x and Gmail for iOS version 6.0.260907. Android Authority confirmed the same versions two days later. Both reports said it was not on Gmail for the web. Google has not published a sender specification for it. There is no documented header, HTML pattern, or subject line that guarantees the pill will appear. Gmail appears to extract the code with heuristics.
Keep the code in the message as real, selectable text, in both the text and html parts. Put one code near the top, at a size a person can read, not only inside an image. Give the subject a plain description, such as “Your Example verification code”. Avoid a second number that could be mistaken for the code. None of that is an official Gmail rule. It is the shape of a message that still works when the button is missing, which it will be on the web and on apps that have not received the update.
On the page that asks for the code, use a normal text input with autocomplete="one-time-code" and a numeric inputmode. That attribute already helps Safari offer an SMS code, and it is the right hook if a mail client and a browser later learn to fill an email code. It does not, by itself, turn on Gmail’s inbox pill.
Send the verification email
Your app should create the code, store a hash of it, set an expiry, and send the message once. SendPanda delivers the email from a verified domain. It does not issue the code or decide when it expires. That is the same split as password-reset and magic-link mail.
Use an idempotency key tied to this challenge, for example the user id and the challenge id, so a retry does not send a second code. Reuse the key only for that event. A new sign-in needs a new key. See sending email and the quickstart for the full request rules.
import { SendPanda } from "@sendpanda/sdk";
const panda = new SendPanda(process.env.SENDPANDA_API_KEY!);
export async function sendVerificationCode(
userId: string,
challengeId: string,
to: string,
code: string,
) {
const email = await panda.emails.send(
{
from: "Example <verifications@example.com>",
to: [to],
subject: "Your Example verification code",
text: `Your Example verification code is ${code}.\n\nThis code expires in 10 minutes. If you did not request it, you can ignore this email.`,
html: `<p>Your Example verification code is:</p>
<p style="font-size:28px;font-weight:700;letter-spacing:0.12em">${code}</p>
<p>This code expires in 10 minutes. If you did not request it, you can ignore this email.</p>`,
tags: [{ name: "category", value: "email-verification" }],
otp_token: { code, origin: "https://example.com" },
},
{ idempotencyKey: `otp-${userId}-${challengeId}` },
);
return { id: email.id, status: email.status };
}
Call this from a server route or a server action, not from the browser. The Node.js SDK refuses to construct itself when window is defined. Watch delivery and bounce webhooks: a queued response means SendPanda accepted the message, not that it reached the inbox.
Do not add a List-Unsubscribe header to a sign-in or sign-up code. Transactional mail does not need it, and an unsubscribe link on a security message is a poor prompt. Keep this traffic on the transactional side of the account, ideally a dedicated subdomain, as described in transactional email and newsletters.
The OTP-Token header
“Copy code” still leaves the person holding a code that they can paste anywhere, including a phishing page. The OTP-Token header is a proposed way to carry the same code in a machine-readable form, bound to the site that asked for it.
The format lives in an individual Internet-Draft, draft-goto-otp-token-01, dated 21 September 2026, by Sam Goto and Mike West at Google. It is not an IETF standard, it expires on 25 March 2027 unless it is revised, and the draft says to treat it as work in progress. The example in the draft is:
OTP-Token: "123456"; origin="https://example.com"
The value is a Structured Fields item: a quoted string for the code, and a required origin parameter. The origin is the ASCII form of the page that will accept the code, in canonical form — lowercase host, default ports omitted, no path, no trailing slash, and not the opaque origin null. HTTPS is the usual case. The header may appear at most once, on the message itself, not inside a MIME part.
The draft describes this as an email-based counterpart to origin-bound one-time codes in SMS. A client that understood the header could offer the code only to that origin. As of late 2026, no mail app is documented as reading OTP-Token. Gmail’s Copy code button is a separate, heuristic feature. A later hook such as WebOTP with transport: ['email'] has been discussed in commentary; it is not in the draft, and it is not a shipping browser API.
Whether receivers should require DKIM or DMARC before they trust the header is unset: the draft’s security section still has a placeholder about DKIM. You should still sign and align the message so it arrives. Do not treat alignment as a documented rule for this header.
Unknown headers are ignored by software that does not understand them, so OTP-Token does not break an older inbox. SendPanda sets it from otp_token on POST /v1/emails and in @sendpanda/sdk. Pass the same code you put in the body, and the origin of the page that will accept it, such as https://example.com. SendPanda writes one header on the message itself: OTP-Token: "<code>"; origin="<origin>". The Resend-compatible path accepts that same header in headers, next to In-Reply-To and References. There is still no general headers field. Any other header is rejected. No mail client is documented as reading OTP-Token yet. A client that does not understand it ignores the header. Keep the code in the body as well.
The Email Verification API
The third change can skip the email altogether, for some users, on some browsers.
Chrome’s Email Verification API lets the browser talk to the email provider and return a signed token that your server can check. The person stays on your form. There is no code to copy and no link to click. This is not the Credential Manager API, and it is not the Android Digital Credentials feature for native apps. Chrome documents those as separate.
As of Chrome’s current documentation, this is an origin trial: Chrome 150 to 160 on desktop, and Chrome 154 to 160 on Android. You register, then serve the trial token on the page that has the form. Tokens issued before a trial extension expired on 17 November 2026 and have to be renewed. An October 2026 Chrome blog post said the team did not expect further breaking changes and was preparing to ship; that is not the same as the trial being over. Gmail can issue tokens in the trial when the user is signed in to that Google Account in the same browser profile.
To try it, add a hidden field to the same form as the email input, with a unique, session-bound nonce that you also store server-side:
<form method="post" action="/signup">
<label>
Email
<input name="email" type="email" autocomplete="email" required>
</label>
<input
type="hidden"
name="token"
autocomplete="email-verification-token"
nonce="SERVER_GENERATED_NONCE">
<button type="submit">Continue</button>
</form>
Chrome fills that field on submit if verification succeeded. If the field is empty — wrong browser, no provider support, no signed-in session, the user submitted too early, or the trial token is missing — fall back to the OTP or magic-link email you already send. There is no feature-detection call to branch on first.
When a token is present, validate it on the server. The value is an SD-JWT with key binding. Check that email_verified is true, that email matches the submitted address (compare case-insensitively), that aud is your site’s HTTPS origin, that nonce matches the value you rendered, and that the token is unexpired. Then confirm the _email-verification.<domain> TXT record, fetch the issuer’s /.well-known/email-verification metadata and JWKS, and verify both signatures. The verifier guide covers the case where Gmail omits a kid and you have to try the issuer’s keys. If any step fails, send the email.
Even a valid token only proves that the browser had an active session with the provider of that address. It does not prove a later message from you was delivered. You may still want a welcome email, and you still need the OTP path for Apple Mail, Outlook, people who are not signed in to webmail, and every browser that is not in the trial.
Keep the message deliverable
A well-written code is useless if the message never arrives. Signup and verification mail fails most often because the domain is not set up to send, not because the template is unclear. Why app signup emails aren’t arriving is the short checklist.
Send from a domain you have verified. Publish one SPF record for the envelope domain, a DKIM key for your selector, and a DMARC policy on the From domain. Check the SPF record on the name receivers actually evaluate, which can be a subdomain. Confirm the public key and the policy with the other two checkers, then send a test to a mailbox you can open and read Authentication-Results. The checkers read public DNS. They do not prove inbox placement.
How the three changes fit together
Use them as layers, not as replacements for each other.
- Offer the Email Verification API on supporting browsers, and treat a missing token as normal. Send the OTP or magic link you already have.
- Keep sending a human-readable code in
textandhtml, written so it can be copied without a special control. - Set
OTP-Tokento the same code and the exact origin of the page that will accept it. SendPanda does this when you passotp_token. Do not wait for a mail client to read the header before you improve the body of the message.
The Copy code button helps people who use the Gmail app. It does not remove phishing risk, and it does not show up everywhere. The header is the piece that could eventually bind the code to your site. The Email Verification API can skip the inbox for a signed-in Gmail user in Chrome. Until those last two are ordinary, the work that pays off immediately is a clear, deliverable OTP email and a fallback that always runs.
Frequently asked questions
Does the OTP-Token header turn on Gmail’s Copy code button?
No. The button is a reported behaviour in the Gmail app, with no public sender contract. OTP-Token is a separate Internet-Draft. No mail client is documented as reading it yet.
Can I skip sending an OTP email if I adopt the Email Verification API?
Only for users who complete that flow. You still need an email path for everyone else, and for every case where the hidden token field is empty or fails validation.
Is the Email Verification API the same as Credential Manager or Digital Credentials?
No. Chrome’s documentation describes a form-based origin trial that uses autocomplete="email-verification-token" and an SD-JWT token. It also notes a separate Android Digital Credentials feature for apps.
Should a verification email include List-Unsubscribe?
No. Sign-in codes, sign-up codes and password resets are transactional. Gmail and Yahoo’s bulk-sender one-click rule is aimed at promotional mail. An unsubscribe link on a security message is the wrong control.
Can SendPanda send the OTP-Token header today?
Yes. Pass otp_token with the code and the https origin on POST /v1/emails, or send an OTP-Token header on the Resend-compatible path. SendPanda puts that one header on the message. No mail client is documented as reading it yet, and a client that does not understand it ignores the header.
Will a magic link work better than an OTP?
It depends on the product. A link avoids transcription, and an OTP is easier to enter when the mail is on another device. The Gmail Copy code button, if present, helps the OTP case in the mobile Gmail app. For link-based mail, see password-reset and magic-link emails.