The short answer: Clerk has no custom SMTP setting. It sends auth email through its own provider. To send through yours, turn off Delivered by Clerk on each email template, subscribe a webhook endpoint to email.created, and send the email Clerk rendered (recipient, subject, HTML and text) with your email API.
That is more work than an SMTP form, but your code sees each email before it goes out, sets its category and tracking, and makes Clerk's webhook retries safe with an idempotency key.
We build SMTPfast. The Clerk details below come from the Clerk docs and the @clerk/backend source, checked on 22 November 2026; the links are at the end.
When to bother
Clerk's own delivery works and sends from your domain in production (Clerk asks you to publish SPF and DKIM records). Send through your own provider when you want every email your users get in one log, the same sending domain and reputation as your other mail, or your own bounce and complaint handling.
Step 1: verify your sending domain in SMTPfast
- In SMTPfast, open Domains and add the domain you will send from, for example
auth.yourdomain.com. - Publish the records SMTPfast shows: three DKIM CNAME records, an SPF TXT record, a DMARC TXT record, and an MX and a TXT record for the
bounce.subdomain. On Cloudflare, Connect Cloudflare adds them for you. - Click Verify Now and wait for the domain to show as verified.
If Clerk already uses the same domain, keep only one DMARC record on _dmarc.<domain>; Clerk's docs give the same advice. See Domains for the full list.
Step 2: create an API key
In SMTPfast, open API Keys and create a key with only the email:send scope. Put it in your app's server environment:
SMTPFAST_API_KEY=sf_...
CLERK_WEBHOOK_SIGNING_SECRET=whsec_... # from step 4
Step 3: the webhook route
This Next.js App Router route checks the signature with Clerk's verifyWebhook (it reads CLERK_WEBHOOK_SIGNING_SECRET), ignores emails Clerk still delivers itself, and sends the rest with the SMTPfast Node SDK.
npm install @smtpfast/sdk
// app/api/webhooks/clerk/route.ts
import type { NextRequest } from "next/server";
import { verifyWebhook } from "@clerk/nextjs/webhooks";
import { SMTPfast } from "@smtpfast/sdk";
const smtpfast = new SMTPfast(); // reads SMTPFAST_API_KEY
export async function POST(req: NextRequest) {
let evt;
try {
evt = await verifyWebhook(req);
} catch {
return new Response("Invalid signature", { status: 400 });
}
if (evt.type !== "email.created") return new Response(null, { status: 204 });
const email = evt.data;
// Clerk already sent the templates you did not switch over.
if (email.delivered_by_clerk || !email.to_email_address) return new Response(null, { status: 204 });
await smtpfast.emails.send(
{
from: "Acme <[email protected]>",
to: [email.to_email_address],
subject: email.subject ?? "Your Acme account",
html: email.body,
text: email.body_plain ?? undefined,
category: "transactional",
track_clicks: false,
},
{ idempotencyKey: `clerk-${email.id}` },
);
return new Response(null, { status: 204 });
}
Notes on the fields, from the EmailJSON type in @clerk/backend:
to_email_address,subject,body(HTML) andbody_plainare the email Clerk would have sent.slugnames the template (for example a verification code), anddataholds its values. Clerk's docs say a verification code email's event contains theotp_code, so you can also render your own template fromdatainstead of usingbody.delivered_by_clerkis true when Clerk sent the email itself.
category: "transactional" keeps the email out of marketing opt-outs and leaves out the unsubscribe header. track_clicks: false sends the sign-in links exactly as Clerk wrote them. The idempotency key is the Clerk email id, so a retried webhook within 24 hours returns the first send instead of sending again.
The request comes from Clerk, not from a signed-in user. If your Clerk middleware protects every route, leave /api/webhooks(.*) out of the protected routes.
Step 4: switch Clerk over
- In the Clerk Dashboard, open Webhooks, add an endpoint with your route's URL (
https://yourapp.com/api/webhooks/clerk) and subscribe it toemail.created. Copy its signing secret intoCLERK_WEBHOOK_SIGNING_SECRET. - Open the Emails page, select a template, and turn off Delivered by Clerk. Repeat for every template you want to send yourself; there is no switch for all of them at once.
Switch one template first (for example the verification code), test it, then do the rest.
Step 5: test it
- Sign up or sign in with an address you can read, so Clerk creates the email you switched over.
- In the Clerk Dashboard, the webhook endpoint shows the attempt and your route's response. A failed attempt can be replayed from there.
- In SMTPfast, open Emails to see the message, its status and its delivery attempts.
- Open the original message in the inbox and check that SPF, DKIM and DMARC pass, or paste the headers into the email header analyzer.
Common errors
| What you see | Cause and fix |
|---|---|
| Webhook returns 400 | The signing secret is wrong or the body was changed before verifyWebhook read it. Use the secret of this endpoint, and do not parse the body yourself first. |
| Webhook returns 404 or redirects to sign-in | Your Clerk middleware protects the webhook route. Leave it out of the protected routes. |
| Users get two emails | Delivered by Clerk is still on for that template, and your route did not skip delivered_by_clerk. |
| Users get no email | Delivered by Clerk is off but the endpoint is not subscribed to email.created, or the send failed. Check the webhook attempts in Clerk and the error your route logged. |
403 Domain ... is not verified |
The from address is not on a verified SMTPfast domain. |
429 from SMTPfast |
Your plan's hourly limit or a first-week stage. The SDK retries a 429; Clerk also retries a failed webhook. See Rate limits. |
| Mail lands in spam | Check that SPF, DKIM and DMARC pass for the from domain and that it has one DMARC record. |
Sources
Checked on 22 November 2026:
- Clerk: Email and SMS templates (Delivered by Clerk,
email.created) - Clerk: Email deliverability (no switch for all templates,
otp_code, SPF, DKIM and DMARC) - Clerk: Webhooks overview (Svix signing and retries) and verifyWebhook()
- Clerk:
EmailJSONin @clerk/backend (event fields) - SMTPfast: Emails API, SDKs
Other auth guides: Supabase Auth, Better Auth, Auth.js / NextAuth and Firebase Authentication.
Frequently asked questions
Does Clerk support custom SMTP?
No. Clerk has no form for an SMTP host, port and password. It delivers email through its own provider, and lets you turn that off per email template with the Delivered by Clerk setting. Clerk then sends you an email.created webhook with the rendered email, and your code sends it.
How do I send Clerk emails with my own provider?
In the Clerk Dashboard, open each email template and turn off Delivered by Clerk. Add a webhook endpoint that subscribes to email.created, verify the webhook signature, and send the to_email_address, subject, body and body_plain fields of the event with your email API.
Can I turn off Clerk email delivery for all templates at once?
No. Clerk's docs say there is no way to disable its email and SMS delivery for all templates at once, so turn it off on each template you want to send yourself.
What happens if my webhook is down?
Clerk sends webhooks through Svix and retries each event until your endpoint returns a 2xx or the retries run out. Use the id of the Clerk email in the event as the idempotency key when you send, so a retried event does not send the email twice.
Ready to get started?
Start sending transactional email today. Free to start, no credit card required.
Start freeRelated Posts
109 MCP Tools vs 2: What Compact Mode Saves (and Costs), Measured
SMTPfast's MCP server now has a compact mode at /api/mcp/compact: two tools, search_api and call_api, in place of 109. The tool list drops from 33,743 tokens to 634. In 100 measured runs on Claude Opus 5.5 and Claude Sonnet 5.5, every task passed in both modes, and compact mode sent 6.6 to 7.1 times fewer input tokens through the model. It was also slower (one more model turn per task), and with a warm prompt cache it cost about the same. It saves money when the tool list is not cached.
Best Email APIs for AI Agents in 2027 (7 Compared, 4 Fully Tested)
For an agent that needs its own inbox, four APIs passed every functional check we ran: SMTPfast, AgentMail, Resend Inboxes and Nylas Agent Accounts. All four sent, received in about 3 seconds, kept reply threads, handled attachments and worked through MCP in Claude Code. AgentMail is the fastest start (an inbox from one API call, no domain, no person); Nylas adds calendars and asks a person to confirm MCP sends; Resend fits if you already send with it; SMTPfast needs your own domain and a paid plan. Postmark received mail but could not send yet while its new-account review was pending. Tested on 22 November 2026.