Custom Domain Email, Part 2: Sending
The previous post covered receiving email at a custom address using Cloudflare Email Routing. This one covers the other half: sending from it.
There are two distinct problems here, and they look similar on the surface but require completely different solutions.
The first is human sending: you want to compose a reply or a new message and have it come from hello@yourdomain.com, not your personal Gmail address. No code involved. Just you, writing an email.
The second is programmatic sending: your application needs to send email — onboarding flows, notifications, password resets, receipts. Code sends it, not you.
These are solved differently. Gmail “Send As” handles the first. Resend handles the second. They don’t conflict, and if you’re building a product, you may end up using both.
Part 1 — Gmail “Send As”
What It Does
Gmail lets you add additional “From” addresses to your account and send from them directly inside the Gmail compose window. When a recipient gets your email, they see your custom domain address — not your Gmail address.
Under the hood, Gmail is sending the message on your behalf using its own SMTP servers. You don’t need to set up any mail server yourself.
Prerequisites
- A Gmail account (personal or Workspace)
- Your Cloudflare Email Routing already configured and working — so replies sent to your custom address actually reach you
- A way to receive a verification email at your custom address (which Cloudflare forwarding handles)
Step-by-Step
1. Open Gmail Settings
In Gmail, click the gear icon → See all settings → go to the Accounts and Import tab.
2. Add Another Email Address
Under Send mail as, click Add another email address.
A small window opens. Enter:
- Name — how you want your name to appear in the From field
- Email address — your custom address, e.g.
hello@yourdomain.com
Leave Treat as an alias checked unless you have a specific reason not to. For most personal and project use cases, alias mode is correct — it means Gmail treats incoming and outgoing mail for this address as part of the same conversation thread.
Click Next Step.
3. Choose SMTP Settings
You’ll be asked how Gmail should send mail for this address. You have two options:
- Send through Gmail — Gmail uses its own SMTP. Easier, no extra setup.
- Send through your own SMTP server — useful if you have one, but unnecessary here.
Select Send through Gmail and continue.
4. Verify the Address
Google will send a confirmation email to hello@yourdomain.com. Because Cloudflare is forwarding that address to your inbox, the verification email will arrive in Gmail itself.
Open it, click the confirmation link (or copy the code into the verification window), and you’re done.
5. Compose and Send
When writing a new email in Gmail, click the From field. Your custom address will appear as an option. Select it, write your email, send.
Recipients see your custom domain address. Replies come back to it. Cloudflare forwards them back to you. The loop is complete.
The Fine Print
The “via gmail.com” header. Depending on the recipient’s email client, they may see a small “via gmail.com” or “sent on behalf of” note next to your name. This comes from the message headers and is technically accurate — Gmail’s servers sent it. Most clients don’t display this prominently, and most recipients don’t notice or care. If it matters to you, the only way to avoid it entirely is to send through your own SMTP server.
Replies default to the address they were sent to. If someone emails hello@yourdomain.com, Gmail will default to replying from that address. If they email your Gmail address, Gmail replies from Gmail. This is correct behaviour, but worth knowing.
It’s tied to your Gmail account. If you switch clients or need another person to send from the same address, this approach doesn’t scale. For teams, Google Workspace or a dedicated mail provider makes more sense.
Part 2 — Resend
What It Is
Resend is an API-first email sending platform. You call it from code. It is not a mail client — there’s no compose window, no inbox, no interface for writing individual emails. It exists to send email from your application: onboarding sequences, notifications, password resets, receipts, anything your product needs to dispatch programmatically.
If you’ve used SendGrid or Postmark, Resend is in the same category — but with a notably cleaner API and a developer experience that doesn’t feel like it was designed in 2009.
The free plan gives you one custom domain, 100 emails per day, and 3,000 per month. For a side project or an early-stage product, that’s usually enough to start.
A Note on DNS
A common misconception: adding Resend to your domain does not require you to change or remove Cloudflare’s MX records.
MX records control inbound mail — they tell the world where to deliver email sent to your domain. Cloudflare’s MX records are what make Email Routing work.
Resend only needs outbound sending authority. That’s established through three DNS records:
- SPF — a TXT record that authorises Resend’s servers to send mail on your domain’s behalf
- DKIM — a TXT record containing a public key that Resend uses to cryptographically sign your outgoing messages, so recipients can verify they genuinely came from you
- DMARC — a TXT record that tells receiving mail servers what to do if SPF or DKIM fails (reject, quarantine, or report)
These records coexist with Cloudflare’s MX records without conflict. Receiving and sending are handled by entirely separate DNS mechanisms. You can have both configured on the same domain simultaneously.
Step-by-Step
1. Create a Resend Account
Go to resend.com and sign up. The free plan requires no card.
2. Add Your Domain
In the Resend dashboard, go to Domains → Add Domain.
Enter your domain name and select a region (US East is the default; pick whichever is geographically closest to your users or infrastructure).
Resend will generate the DNS records you need to add.
3. Add the DNS Records in Cloudflare
You’ll be given three records. Go to your Cloudflare dashboard → your domain → DNS → Records and add each one:
- One or two TXT records for SPF and DKIM
- A DKIM CNAME (Resend uses a CNAME-based DKIM setup rather than a raw TXT key)
- A TXT record for DMARC (if you don’t already have one)
Resend’s dashboard shows exactly what to enter for each. Copy them precisely — DKIM values in particular are sensitive to whitespace.
Once added, click Verify in Resend. DNS propagation can take a few minutes to an hour. When all records show as verified, your domain is ready to send from.
4. Get an API Key
Go to API Keys → Create API Key. Give it a name, set the permission to Sending access, and optionally scope it to your specific domain.
Copy the key. You won’t be shown it again.
5. Send Your First Email
Install the Resend SDK for your language of choice. Here it is in TypeScript:
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);
const { data, error } = await resend.emails.send({
from: 'Your Name <hello@yourdomain.com>',
to: 'recipient@example.com',
subject: 'Hello from your domain',
html: '<p>This came from your application.</p>',
});
That’s it. If your domain is verified and the API key is valid, that email will arrive with hello@yourdomain.com in the From field — no “via” annotation, no visible third-party infrastructure. It looks like it came from you, because as far as the recipient’s mail server is concerned, it did.
Beyond the Basics
React Email. Resend has first-class support for React Email, a library for building email templates as React components. If you’re already in a React or Next.js stack, this is a substantial quality-of-life improvement over writing HTML email by hand.
Webhooks. Resend can POST delivery events (sent, delivered, bounced, complained) to an endpoint you specify. Useful for tracking whether transactional emails actually landed, or for handling bounces gracefully.
Logs. The Resend dashboard keeps a log of every email sent, with delivery status and the ability to preview the rendered content. When something goes wrong, this is where you go first.
Choosing Between Them
They’re not in competition — they solve different problems. But if you’re unsure which you need:
Use Gmail “Send As” if:
- You’re a person who needs to send email from a custom address
- You want replies to loop back through Cloudflare forwarding into your existing inbox
- You don’t want to write any code or touch an API
Use Resend if:
- Your application needs to send email: notifications, confirmations, onboarding, receipts
- You need reliable delivery with signing and authentication at the DNS level
- You want logs, webhook events, and programmatic control over what gets sent and when
Both can be active on the same domain at the same time. Cloudflare handles inbound. Gmail “Send As” handles human outbound. Resend handles application outbound. Each layer does one thing and stays out of the way of the others.


