Docs/Email/Setup

Setup Resend

Configure Resend for transactional emails with custom domain verification.

Environment Variables

VariableDescriptionTypeSource
RESEND_API_KEYResend API key for sending emails*
server
secret
Resend Dashboard → API Keys
RESEND_FROM_EMAILDefault sender email address*
server
safe
Your verified domain email
RESEND_REPLY_TODefault reply-to email address
server
safe
Your support email

* Required variable

Step 1: Get API Key

  1. Go to Resend Dashboard → API Keys
  2. Click "Create API Key"
  3. Give it a name (e.g., "Production")
  4. Select permissions (Full access for simplicity, or restricted for security)
  5. Copy the API key (starts with re_)
Save Your API Key
You'll only see the API key once. Save it securely before closing the dialog.

Step 2: Verify Domain (Recommended)

For better deliverability, verify your domain:

  1. Go to Resend Dashboard → Domains
  2. Click "Add Domain"
  3. Enter your domain (e.g., yourdomain.com)
  4. Add the DNS records shown to your domain registrar
  5. Wait for verification (usually a few minutes)
Development Without Domain
For development, you can send emails from onboarding@resend.devwithout domain verification. Production apps should use a verified domain.

Step 3: Add to .env.local

.env.local
# Email Configuration (Resend)
RESEND_API_KEY=re_xxxxx
RESEND_FROM_EMAIL=noreply@yourdomain.com
RESEND_REPLY_TO=support@yourdomain.com

Step 4: Test Email Sending

Test your configuration with a simple API call:

Example usage
// Example: Send a test email
import { Resend } from 'resend';

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

await resend.emails.send({
  from: process.env.RESEND_FROM_EMAIL,
  to: 'test@example.com',
  subject: 'Hello from VibeCodeMax',
  html: '<p>Your email setup is working!</p>',
});

Troubleshooting

"API key invalid"

Double-check your API key. Make sure there are no extra spaces or characters.

"Domain not verified"

DNS propagation can take up to 48 hours. Check your DNS records are correctly configured.

"Email going to spam"

Verify your domain and set up DKIM/SPF records for better deliverability.

Setup Resend | Email Module | VibeCodeMax Docs