Resend
Last updated December 18, 2025

Overview

Resend is a modern transactional email API built for developers. It's simple to use, has great deliverability, and works perfectly for sending transactional emails like welcome emails, password resets, and notifications.

Account Setup

  1. Go to resend.com and sign up for an account
  2. Verify your email address
  3. You'll start with a free tier that includes 3,000 emails/month and unlimited domains

Get API Key

  1. In your Resend dashboard, go to "API Keys"
  2. Click "Create API Key"
  3. Name it (e.g., "Production" or "Development")
  4. Select permissions (for sending emails, you only need "Sending access")
  5. Click "Add"
  6. Important: Copy the API key immediately - you won't be able to see it again after closing the dialog
  7. This is your RESEND_API_KEY

Domain Setup (Optional but Recommended)

While you can use Resend's test domain initially, setting up your own domain improves deliverability.

Step 1: Add Domain

  1. Go to "Domains" in your Resend dashboard
  2. Click "Add Domain"
  3. Enter your domain (e.g., mg.yourdomain.com - using a subdomain is recommended)
  4. Click "Add"

Step 2: Add DNS Records Resend will show you the DNS records to add. You need to add:

  • SPF Record: v=spf1 include:resend.com ~all
  • DKIM Records: Multiple CNAME records (Resend will provide exact values)
  • DMARC Record (Optional): v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com

Step 3: Verify Domain

  1. Add the DNS records in your domain's DNS provider (Cloudflare, Namecheap, etc.)
  2. Wait for DNS propagation (can take up to 24 hours, usually much faster)
  3. Click "Verify" in Resend dashboard
  4. Once verified, you can send emails from addresses like noreply@mg.yourdomain.com

Environment Variables

Add this variable to your .env.local file:

# Resend
RESEND_API_KEY="re_xxxxxxxxxxxxx"

For Domain Setup: If you've set up a custom domain, you'll also need to specify the "From" email address in your email sending code. For example:

from: "noreply@mg.yourdomain.com"

Without Domain Setup: You can use Resend's test domain:

from: "onboarding@resend.dev"

Note: Emails from the test domain may have delivery limitations.

Testing

  1. Add RESEND_API_KEY to your .env.local
  2. Restart your dev server: npm run dev
  3. Trigger an email (e.g., sign up a user, reset password)
  4. Check your email inbox
  5. In Resend dashboard → "Logs", you can see email delivery status

Test Email Script: You can test sending emails directly:

import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

await resend.emails.send({
  from: 'onboarding@resend.dev',
  to: 'your-email@example.com',
  subject: 'Hello World',
  html: '<p>This is a test email!</p>',
});

Troubleshooting:

  • If emails don't arrive, check the "Logs" in Resend dashboard for error messages
  • Verify your API key is correct
  • For production, ensure domain is verified
  • Check spam folder if using test domain