Skip to main content
1

Create Resend Account

Get started:
  1. Go to resend.com and sign up
Free tier: 100 emails/day - 3000 emails/months
2

Get API Key

Generate your key:
  1. Click API Keys in sidebar
  2. Click Create API Key
  3. Name it (e.g., “Development”)
  4. Permissions: Sending access
  5. Click Create
  6. Copy the key (starts with re_)
Add to .env.local:
.env.local
RESEND_API_KEY=re_xxxxx
Keep this secret. Never commit to git.
3

Set Up Your Domain (Optional)

Default: emails send from onboarding@resend.devTo use your own domain:
  1. In Resend, click Domains
  2. Click Add Domain
  3. Enter your domain: yourapp.com
  4. Copy the DNS records
  5. Add them to your DNS provider (Cloudflare, Namecheap, etc.)
  6. Click Verify DNS Records
Yes! Resend’s default domain works for testing. Add your own domain before launch for better deliverability.
4

Configure Sender Emails

Open /config.ts and update:
/config.ts
export const config = {
    // ... other settings
    resend: {
        fromNoReply: 'YourApp <noreply@yourapp.com>',
    	fromAdmin: 'YourName at YourApp <admin@yourapp.com>',
    	supportEmail: 'support@yourapp.com',
    },
}
Replace with your actual addresses.
Use your domain from Step 3, or keep @resend.dev while testing.
5

Send Your First Email

Email functions are ready to use. Import and call:
import { sendEmail } from '@/lib/resend'

await sendEmail({
  to: 'user@example.com',
  subject: 'Welcome!',
  text: 'Thanks for signing up',
  html: '<p>Thanks for signing up!</p>',
})
Done! Email sent 🎉

Email Best Practices

Keep It Simple

Plain text + basic HTML. Most email clients don’t support complex CSS.

Include Both Formats

Always send text AND html. Some users block HTML.

Use a Subdomain

Send from mail.yourapp.com instead of yourapp.com to protect your main domain’s reputation.

Test Before Sending

Send to yourself first. Check on mobile and desktop.

Improve Deliverability

Click tracking modifies links, which can trigger spam filters. Disabling it improves deliverability.
Tracking pixels can flag emails as spam. Disable for better inbox placement.
Links should match your sending domain. Mismatched URLs trigger spam filters.
DMARC tells email providers how to handle failed authentication. Add this TXT record:
    v=DMARC1; p=quarantine;
Gmail clips emails over 102KB. Keep body text and images small.
Use real addresses like support@yourapp.com. One-way communication reduces trust.
Images from other domains look suspicious. Host on your sending domain.
Gmail doesn’t support SVG. Use PNG or JPG instead.

For Marketing Emails

Add unsubscribe links (required by law):
<p style="color:#666;font-size:12px;margin-top:40px">
  Don't want these emails? 
  <a href="https://yourapp.com/unsubscribe">Unsubscribe</a>
</p>

Monitor Your Emails

In Resend dashboard:
  • Emails tab shows all sent emails
  • Check delivery status
  • See open/click rates
  • Track bounces and complaints
High bounce rate? Check domain verification and DNS records.

Troubleshooting

Check:
  • RESEND_API_KEY in .env.local
  • API key has Sending access
  • No typos in email addresses
  • Resend dashboard for errors
Fix:
  • Verify your domain (add DNS records)
  • Use your domain, not @resend.dev
  • Avoid spam words: “FREE!”, “URGENT”
  • Don’t send too many emails too fast
Common issues:
  • Wait up to 60 minutes for DNS propagation
  • DNS records must match exactly (no spaces)
  • Some DNS providers need @ instead of domain name
  • Try verifying again after waiting
Free tier: 100 emails/daySolutions:
  • Upgrade to paid plan
  • Batch emails instead of individual sends
  • Check usage in Resend dashboard