Firebase Auth custom SMTP: auth emails from your own domain
Runearc sends Firebase Authentication emails (verification, password reset and email link sign in) from your own domain in two ways. Without code, paste Runearc's SMTP settings into Firebase's Authentication, Templates, SMTP settings. With code, generate each link with the Firebase Admin SDK and send your own email through Runearc's REST API with fetch.
SMTP settings enabled
Sender address noreply@acme.com
SMTP server host smtp.runearc.com
Port 465
Username runearc
Password mb_live_xxxxxxxxx (a Sending only key)
Security mode SSL (or 587 with STARTTLS)
Two ways to send them
Firebase's client SDKs send verification, password reset and sign in emails for you. Firebase's own docs say those emails are sent by Google and have limited customizability. Runearc fits in at two points: as the SMTP server Firebase sends its templates through, or as the email API your server calls after the Admin SDK has made the link.
no codePath 1: SMTP settings
Firebase keeps its templates and its sending. Runearc carries the mail fromnoreply@yourdomain. Six fields in the console.firebase-admin + fetchPath 2: Admin SDK links
Your server generates the link withgenerateEmailVerificationLink,generatePasswordResetLinkorgenerateSignInWithEmailLinkand sends your own email throughPOST /v1/emails.
Sources, read on November 25, 2026
- [1]Firebase, use a custom domain for Authentication emails: firebase.google.com/docs/auth/email-custom-domain
- [2]Firebase, generating email action links: firebase.google.com/docs/auth/admin/email-action-links
- [3]Firebase Help, email templates: support.google.com/firebase/answer/7000714
- [4]Identity Platform, project config reference (the SMTP relay fields): docs.cloud.google.com/identity-platform/docs/reference/rest/v2/Config
If something here is out of date or wrong, email hello@runearc.com and we will fix it.
Set up
The first two steps are the same for both paths.
- 1
Verify your domain
Add it in Runearc and publish the records it lists. Auth email then goes out asnoreply@yourdomain. The records are explained in the domains docs. - 2
Create a Sending only key
On the API keys page. It can send and read the send log, nothing else. Copy it now: it is shown once. - 3
Pick a path
Paste the SMTP settings into the Firebase console, or add the Admin SDK code to your server. Both are below.
Path 1: SMTP settings in the Firebase console
Documented from Firebase's docs; we did not run this path against a Firebase project.
- Sender address
- noreply@yourdomain.comAny address on your verified domain
- SMTP server host
- smtp.runearc.com
- Port
- 465Or 587
- Username
- runearc
- Password
- mb_live_...Your Sending only key
- Security mode
- SSLSTARTTLS if the port is 587
- In the Firebase console, open your project, then Authentication, Templates. In the newer console it sits under Security, Authentication.
- Open SMTP settings and turn it on.
- Fill in the six fields from the card. The labels may differ slightly between console versions; they map to the sender email, host, port, username, password and security mode of Firebase's SMTP relay.
- Pair the security mode with the port: SSL with
465, or STARTTLS with587. Save. - Edit each template's sender name and subject if you like. The sender address must stay on the domain you verified in Runearc.
- Send yourself a password reset from your app. It shows in Runearc's Sending log with its delivery status.
Using multi-tenancy with Identity Platform? Firebase's docs say each tenant must be set to inherit the project's custom domain, templates and SMTP settings, or its users still get email from the default sender.
Path 2: Admin SDK links, sent with fetch
The Admin SDK makes the same links Firebase would put in its own emails, and leaves sending to you. Three functions below generate each link and send it with one fetch to Runearc's emails API. No Runearc package to install. Errors come back as JSON with a code, a message and a fix.
npm install firebase-admin
export RUNEARC_API_KEY=mb_live_xxxxxxxxx # a Sending only key
export EMAIL_FROM="Acme <noreply@acme.com>" # on your verified domainimport { initializeApp } from "firebase-admin/app";
import { getAuth, type ActionCodeSettings } from "firebase-admin/auth";
initializeApp(); // on Google Cloud; elsewhere pass { credential: cert(serviceAccount) }
const RUNEARC_API = process.env.RUNEARC_API_URL ?? "https://api.runearc.com/v1";
const FROM = process.env.EMAIL_FROM ?? "Acme <noreply@acme.com>"; // on your verified Runearc domain
// Where the user lands after Firebase handles the link.
const settings: ActionCodeSettings = { url: "https://acme.com/welcome" };
async function send(to: string, subject: string, link: string): Promise<string> {
const res = await fetch(`${RUNEARC_API}/emails`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RUNEARC_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
from: FROM,
to: [to],
subject,
html: `<p>${subject}:</p><p><a href="${link.replaceAll("&", "&")}">Open the link</a></p>`,
text: `${subject}: ${link}`,
tags: [{ name: "category", value: "auth" }],
}),
});
const body = await res.json();
// Every error has a code, a message and a fix.
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message} (${body.error.fix})`);
return body.id; // eml_...
}
export async function sendVerificationEmail(email: string) {
const link = await getAuth().generateEmailVerificationLink(email, settings);
return send(email, "Verify your email for Acme", link);
}
export async function sendPasswordResetEmail(email: string) {
const link = await getAuth().generatePasswordResetLink(email, settings);
return send(email, "Reset your Acme password", link);
}
export async function sendSignInLink(email: string) {
// Email link sign in needs handleCodeInApp: true and the Email link provider turned on.
const link = await getAuth().generateSignInWithEmailLink(email, { ...settings, handleCodeInApp: true });
return send(email, "Sign in to Acme", link);
}import { getAuth } from "firebase-admin/auth";
import { sendPasswordResetEmail, sendSignInLink, sendVerificationEmail } from "./auth-email.js";
// Sign up on your server: create the user, then send the verification email.
export async function signUp(email: string, password: string) {
const user = await getAuth().createUser({ email, password });
await sendVerificationEmail(email);
return user.uid;
}
// "Forgot password" and "Email me a sign in link" endpoints call these.
export const forgotPassword = (email: string) => sendPasswordResetEmail(email);
export const emailSignInLink = (email: string) => sendSignInLink(email);The links open Firebase's action handler, which applies the code and then sends the user to settings.url. For email link sign in, your app still completes the sign in with the client SDK's signInWithEmailLink, and the Email link provider must be on under Sign in method. The ActionCodeSettings fields for mobile apps (iOS, android, linkDomain) are in Firebase's action links guide.
A real run
Every snippet in Path 2 passes tsc --noEmit with firebase-admin 14.5.1, TypeScript 7.0.2 and the Firebase Auth emulator from firebase-tools 15.37.0, on November 25, 2026. We then ran it against the emulator and a local Runearc stack: a user was created, and sendVerificationEmail, sendPasswordResetEmail and sendSignInLink each returned an email id that reached delivered. We read the verification email back from Runearc, applied the code in its link the way the client SDK does, and the user's emailVerified turned true. The capture is at the top of this page. Path 1 was not run.
What it does not do
- It does not edit Firebase's templates. With Path 1, the subject and body are still the ones you set in Firebase. Runearc only carries the mail.
- It does not send from an unverified domain. The sender address must be on a domain verified in the key's workspace; otherwise SMTP gets 550 5.7.1 and the API gets
sender_not_verified. - It does not replace Firebase's action handler. The links still go to Firebase, which applies the code. A custom handler page is a Firebase feature you build separately.
- It does not change Firebase's own quotas. Firebase limits how many auth emails a project can trigger; Runearc's plan limits apply on top.
- No Runearc SDK in this guide. Path 2 uses
fetch, which runs in Node 18 and later, Cloud Functions and any server.
If emails do not arrive
- 535 5.7.8 authentication failed
- The password is not a valid key. Paste a Sending only key; inbox keys cannot send over SMTP. More on 535 5.7.8.
- 550 5.7.1 not a domain of this workspace
- The sender address is on a domain that is not verified in the key's workspace. Verify it, or change the sender. More on 550 5.7.1.
- SMTP connection fails or times out
- The security mode and port do not match. Use SSL with 465 or STARTTLS with 587, and the host
smtp.runearc.com. - sender_not_verified
- The API's version of the same problem:
EMAIL_FROMis not on a verified domain. The error'sfixnames the command that verifies it. - auth/user-not-found or auth/email-not-found
- From the Admin SDK: no Firebase user has that email. Verification links need an existing user, and password reset returns
auth/email-not-found. Create the user first. - Delivered, but in spam
- Send one email to the email deliverability test to check SPF, DKIM and DMARC for your domain.
On Supabase instead? The Supabase Auth custom SMTP guide has the same settings for its dashboard, and SMTP providers for Supabase compared helps you choose a sender. Sending receipts and other app email from code too? The Next.js guide uses the same key. Every SMTP field is on the SMTP docs page, and every tool is in the integrations directory.
Questions
Which path should I pick?
The SMTP settings if Firebase's templates are enough: no code, and Firebase keeps sending the emails it already sends. The Admin SDK path if you want to write the emails yourself, in your own HTML and words, or send the email link sign in message your way. You can use both at once.
Did you test this with Firebase?
The Admin SDK path, yes: the code on this page ran against the Firebase Auth emulator and a local Runearc stack on November 25, 2026, and the verification link from the delivered email verified the user. The console SMTP settings need a real Firebase project, so we did not run them; that section follows Firebase's docs.
Should I use SSL or STARTTLS?
Either, as long as the port matches. Security mode SSL goes with port 465, which is TLS from the first byte. STARTTLS goes with port 587, which starts plain and upgrades. Runearc accepts a login only after TLS on both.
Do I still need Firebase's custom domain setting?
Not for the From address: with Runearc the sender is your domain once you publish the SPF and DKIM records Runearc lists for it. Firebase's custom domain setting also changes the domain in the action links; set it up too if you want the links on your domain.
What does it cost?
Runearc's free plan includes 3,000 emails a month and 3 custom domains, with no card. Received mail never counts toward that. Pro is $9 a month.
Do these emails show in Runearc's logs?
Every email goes into Runearc's Sending log with its status, from the SMTP path and the API path alike, and a hard bounce adds the address to the workspace's suppressions.
Related integrations
- Supabase AuthCustom SMTP for sign up, magic link and password reset emails.
- ClerkTurn off Delivered by Clerk, send each email.created webhook through Runearc's API.
- Better AuthOne fetch helper for verification, reset, magic link, OTP and invitation emails.
- Next.jsSend from a route handler with the Resend SDK, the Runearc SDK or fetch.
Read next
Put Runearc to work
Get inboxes, sending, your own domains and MCP in one workspace. The free plan includes 3 inboxes, 3,000 emails a month and 3 custom domains, with no card.