Back to Blog
/6 min read/By SMTPfast Team

How to Send Clerk Emails Through Your Own Provider (Clerk Has No Custom SMTP)

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, listen for the email.created webhook, and send the subject and body Clerk rendered with your email API. This guide does it with a Next.js route and the SMTPfast Node SDK.

clerkauthwebhooksnextjstutorial
Share:𝕏in

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

  1. In SMTPfast, open Domains and add the domain you will send from, for example auth.yourdomain.com.
  2. 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.
  3. 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) and body_plain are the email Clerk would have sent.
  • slug names the template (for example a verification code), and data holds its values. Clerk's docs say a verification code email's event contains the otp_code, so you can also render your own template from data instead of using body.
  • delivered_by_clerk is 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

  1. In the Clerk Dashboard, open Webhooks, add an endpoint with your route's URL (https://yourapp.com/api/webhooks/clerk) and subscribe it to email.created. Copy its signing secret into CLERK_WEBHOOK_SIGNING_SECRET.
  2. 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

  1. Sign up or sign in with an address you can read, so Clerk creates the email you switched over.
  2. In the Clerk Dashboard, the webhook endpoint shows the attempt and your route's response. A failed attempt can be replayed from there.
  3. In SMTPfast, open Emails to see the message, its status and its delivery attempts.
  4. 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:

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 free