antrix.dev
Free guide

Email with Resend

Send transactional and marketing emails with Resend. Welcome emails, receipts, and delivery — all automated.

Reading this alone?

Do it with peers — bi-weekly calls, $29/mo founding.

Join →

What it does

Resend is an email API for developers. It handles sending emails from your app — you call one function and the email goes out. No SMTP configuration, no mail server management, no deliverability tuning. You focus on what the email says and Resend handles getting it into inboxes.

There are two categories of email your app will send. Transactional emails are triggered by user actions — welcome emails on signup, purchase receipts after checkout, password reset links, delivery instructions for digital products. These are one-to-one and time-sensitive. Marketing emails are one-to-many — newsletters, product announcements, campaigns. Resend handles both.

Under the hood, Resend manages deliverability — the hard problem of getting your emails into inboxes instead of spam folders. It handles SPF and DKIM authentication automatically, provides analytics for opens, clicks, and bounces, and integrates natively with React through React Email so you can build templates as components instead of raw HTML strings.

Why we use it

The alternatives are painful. SendGrid is complex and enterprise-focused — the dashboard alone has dozens of tabs you'll never touch. Mailgun is API-first but the developer experience feels dated, with verbose configuration and clunky SDKs. Resend is modern, built for developers who use React, and has the cleanest API in the space. One function call. That's it.

The free tier gives you 3,000 emails/month — enough to build your product, launch, and start generating revenue before you pay a cent. React Email lets you build templates with components you already know — no learning a new templating language. Deliverability works out of the box once you verify your domain. You won't outgrow the free tier until you have serious volume, and by then the upgrade is trivial.

Setup checklist

1

Create a Resend account

Go to resend.com and sign up. The free tier gives you 3,000 emails/month, 100 emails/day, 1 custom domain, and 1 API key. That's enough for all of development, your launch, and early traction — most apps don't send 100 emails a day until they have real paying customers. You can upgrade later when volume grows, but don't pay before you need to.

2

Verify your domain

Go to Domains > Add Domain in the Resend dashboard. Resend gives you 3 DNS records to add at your domain registrar: an SPF record, a DKIM record, and a verification TXT record. These prove to email providers that you're authorized to send from your domain.

Add all three records exactly as shown. Verification takes anywhere from 5 minutes to an hour depending on your registrar's DNS propagation speed. Without a verified domain, your emails will land in spam or get rejected entirely. This step is non-negotiable.

3

Get your API key

Go to API Keys > Create API Key. Give it a descriptive name (e.g., "production" or "development"). Copy the key immediately — you won't see it again after leaving the page. Add it to your .env.local file as RESEND_API_KEY. This key is server-side only — never expose it in client code or NEXT_PUBLIC_ variables.

4

Install the SDK

Run npm install resend in your project. Then create a Resend client file at lib/resend.ts. Import Resend from the package, initialize it with your API key from environment variables, and export the client. This gives you a typed client that handles authentication and request formatting for every email you send.

5

Build your first email template

You have two approaches for templates, and they're not mutually exclusive. HTML strings are the simplest path — you write the HTML directly in a template literal, interpolate variables with `${name}`, and pass it to resend.emails.send(). This is fine for most projects, especially when starting out. No extra dependencies, no build step, just a function that returns HTML.

React Email is the more powerful approach. Install @react-email/components and build templates as React components using pre-built primitives like <Html>, <Section>, <Text>, and <Button>. These components handle the cross-client compatibility nightmares for you — they output the table-based HTML that email clients actually render correctly. Use render() to convert the component to an HTML string when sending. The advantage: your templates are type-safe, composable, and version-controlled alongside your app code.

For either approach, build templates that match your brand — dark backgrounds, your colors, your logo. Keep the layout simple. Email clients are not browsers — stick to tables for layout, inline styles, and basic HTML. Avoid CSS grid, flexbox, or anything fancy. Test how it renders before sending to customers.

6

Send your first email

Create a function that calls resend.emails.send() with four fields: from (must match your verified domain), to (the recipient), subject, and html (your template). Test it by sending to yourself. Check that it arrives, looks correct, and doesn't land in spam.

7

Set up transactional emails

Map out every email your app needs to send. Common ones: welcome email on signup, purchase confirmation after checkout, delivery instructions for digital products, password reset links. Each one is a function that builds the HTML with the relevant data (customer name, order details, reset link) and calls resend.emails.send().

Keep your email functions in a single file like lib/emails.ts so every email trigger in your app calls the same module. This makes it easy to update templates, change the from address, or add logging in one place.

8

Configure the "from" address

Use a professional format: "YourName <hello@yourdomain.com>" or "YourBrand <noreply@yourdomain.com>". The from address must match your verified domain exactly. If your verified domain is yourdomain.com, you can send from any address at that domain (hello@, support@, noreply@) without additional setup.

9

Handle errors and rate limits

Wrap every resend.emails.send() call in a try/catch. Emails can fail for many reasons — invalid addresses, rate limits, API outages. Log every failure. You need to know when emails don't send, because your customers won't tell you they didn't get a confirmation.

The free tier allows 10 emails per second. If you're doing bulk sends (like a newsletter), add delays between batches or use Resend's batch API which handles throttling for you. For transactional emails (one at a time in response to user actions), you'll rarely hit rate limits.

10

Set up delivery tracking

Resend tracks opens and clicks automatically. View them in the dashboard under Emails. For programmatic tracking, set up webhooks at Resend > Webhooks to get notified of bounces and complaints.

Bounces and complaints directly affect your deliverability. If you keep sending to addresses that bounce, email providers will start flagging all your emails as spam. Use webhook events to automatically suppress bad addresses from future sends.

Pro tips

Use React Email for complex templates — install @react-email/components, build templates as React components, and render to HTML with render().

Preview templates locally — run npx react-email dev to see templates in the browser with hot reload as you edit.

Use the batch API for bulk sends resend.batch.send([...]) sends up to 100 emails in one call, handling throttling for you.

Monitor your domain reputation — high bounce rates damage deliverability for all your emails, not just the ones that bounced. Check the Resend dashboard regularly.

Send email code

// lib/resend.ts
import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_API_KEY);

export async function sendWelcomeEmail(to: string, name: string) {
  try {
    const { data, error } = await resend.emails.send({
      from: "YourBrand <hello@yourdomain.com>",
      to,
      subject: `Welcome, ${name}!`,
      html: `<h1>Welcome aboard</h1><p>You're in. Here's what to do next...</p>`,
    });

    if (error) {
      console.error("Failed to send welcome email:", error);
      return { success: false, error };
    }

    return { success: true, id: data?.id };
  } catch (err) {
    console.error("Resend API error:", err);
    return { success: false, error: err };
  }
}

AI prompt to get started

I need to set up transactional emails with Resend for my Next.js app. Help me create: 1) A Resend client module, 2) HTML email templates for welcome, purchase confirmation, and password reset that match a dark theme with brand color #E8613C, 3) An API route that sends emails, 4) Error handling with retry logic.

Mistakes to avoid

  • Not verifying your domain — emails from unverified domains land in spam or get rejected entirely
  • Sending from a free email address (gmail, outlook) — always use your custom verified domain
  • Not handling send failures — wrap in try/catch, log errors, have a fallback. Silent failures mean customers never get their emails
  • Building complex email templates without testing — email clients render HTML differently than browsers. Test in Gmail, Outlook, and Apple Mail
  • Not setting up SPF/DKIM/DMARC — Resend handles SPF and DKIM, but add a DMARC record manually for maximum deliverability
  • Sending too many emails too fast — respect rate limits, use the batch API for bulk sends

Reading this and want to actually do it with others?

The community is bi-weekly live calls, async accountability, and a group of builders shipping in parallel. Founding seats are $29/mo.

[ 01 ] the community · waitlist open

Build next to people who actually ship.

AI isn't going to make you money. Products do. Clients do. Real businesses do. AI is the unfair advantage — wire it into how you build, sell, and serve, and you move faster than everyone still doing it by hand.

operator:youwaitlist:openfleet:yours to installcalls:weekly liveprice:$29/mo founding

Is this you?

$ qualify --you

  • You live in Claude Code (or Codex) all day — and you're still the one doing every task, one prompt at a time.
  • You bill by the hour, and you can feel the ceiling. You want agents doing the repeatable work.
  • You're shipping your own thing — and want the whole business automated, not just the code.
  • You're senior and employed — and want this leverage running before your industry expects it.
  • You'd rather install the system than watch one more video about it.
  • Not for the make-money-online crowd. Not for day-one beginners. This is for people who already ship.

What you get

os/

Antrix OS — your fleet's control room

The system I run on real client work, installed where you build — not a video walkthrough.

Claude Code core MCP servers + hooks subagents + worktrees one dashboard

skills/

ax-* skill packs + installers

Drop-in capability. The packs and one-command installers that do the repeatable work.

  • ax-audit, ax-deliver, ax-simplify, ax-content
  • Ship Your Product — installer
  • Run the Machine — installer
  • Overnight pipelines: issues → PRs

setups/

Wired-up service setups

The integrations already configured the way production needs them.

  • Stripe — billing + webhooks
  • Supabase — auth + data
  • Vercel — deploy + edge
  • Resend — transactional email

access/

Direct access — to me and the network

When you're mid-build and stuck, you post and get an answer from someone who's shipped it.

  • Live working calls every week — builds, teardowns, Q&A
  • Architecture + payment reviews on your code
  • A peer network of operators who ship, not spectate
  • First look at overflow client work
Antrix OS — projects across every company, with live agents and open tasksAntrix OS — the agent roster: system agents, PMs, personas, and workers

← drag to explore the dashboard

The control room you'll run your fleet from — every project, agent, skill, schedule, and secret in one place. Members get the codebase.

$ fleet --ships

IG carousels, drafted overnightLead lists scraped for consultingClient reports + invoices, generatedContent research, done by morningOvernight PRs from open issuesWeekly ops digest, auto-assembled

[ 03 ] work with me directly

Hire me, and you get me — not an agency.

Don't want to run the fleet yourself — or need senior hands on your product now? I take a few clients each quarter, working direct on your codebase, your stack, your business. No junior handoffs, no account managers. Best fit if you're already shipping something real.

You're stuck on the hard part

We pair and ship it — the product, the agent, or the integration that's been blocking you — in the session, not in a follow-up doc.

AI is still just a chat window for you

I wire agentic workflows, multi-agent pipelines, and scheduled jobs into your business — turning AI from a tab you open into real leverage on revenue work.

You shipped it but you're not sure it holds

I review architecture, AI usage, and payments, then tell you what to keep, what to rip out, and what to ship next. Straight, no hedging.

You want to run it yourself

Sometimes you don't need me to run it — you need me in the room while you do. I set up the system and hand you the keys.

Specialty — payments & billing

If your product touches money, that's where I help most — subscriptions, marketplaces, and migrations at Babbel scale, Stripe-certified. Those engagements run through my consulting practice at invocation.io.

Tell me what you're building.

I reply within 24 hours.