Resend in Next.js — send your first email
Three steps: get an API key, verify your domain, set the sender. Follow along and you'll have transactional emails (sign-in links, receipts) working from your app.
Send emails from your app
Transactional emails are the ones your app sends automatically: password reset, order confirmation, sign-in links. Resend delivers them for you. Follow the three steps below and you'll have your first email going out from your Next.js app.
Step 1: Get an API key
Open resend.com in your browser. Click Sign up (or Log in if you already have an account). After you're in, go to API Keys in the sidebar (or open resend.com/api-keys). Click Create API Key, give it a name (e.g. "Next.js app"), then copy the key — it starts with re_. Create a file .env.local in your project root if you don't have one, and add this line (paste your key):
# .env.local
RESEND_API_KEY=re_xxxxxxxxxxxxStep 2: Verify your domain
In the Resend dashboard go to Domains (or open resend.com/domains). Click Add Domain. Enter the domain you want to send from (e.g. yourdomain.com) and click Add. Resend will show you DNS records (SPF, DKIM, etc.) — open your domain provider (e.g. Cloudflare, Namecheap, Vercel) and add each record they list. Wait a few minutes, then back in Resend click Verify. Once it shows Verified, you can use that domain in your "From" address. For testing without a custom domain you can use Resend's sandbox domain; for production, use the domain you just verified.
Step 3: Set the sender and send your first email
In .env.local add the sender email and name. The email must use the domain you verified in Step 2 (e.g. noreply@yourdomain.com). Add these lines:
# Add to .env.local (same file as Step 1)
RESEND_FROM_EMAIL=noreply@yourdomain.com
RESEND_FROM_NAME=Your App NameRestart your Next.js dev server so it loads the new env vars. From here, any sendEmail call in your app can use RESEND_FROM_EMAIL and RESEND_FROM_NAME as the default "From" — you're ready to send.
Resend already wired in
The boilerplate includes Resend, ready-to-use templates for post-purchase and magic-link emails, and domain setup. Add your key and domain, and you're ready to ship.
Get the boilerplate