Infrastructure
Resend: Sending Emails
Make your app send beautiful emails — confirmations, notifications, and more
What kind of emails are we talking about?
There are two kinds of email. Marketing emails are newsletters and promotions sent to a list (tools like Mailchimp handle those). Transactional emails are triggered by something the user does — that's what Resend is for.
- "Welcome to [your app]!" after someone signs up
- "Here's your password reset link"
- "Your order has shipped" with tracking info
- "Someone commented on your post" notifications
- Receipts and invoices after a purchase
Getting started (no code)
- Sign up at resend.com
- Find your API key in the dashboard — it looks like
re_abc123... - Use the API playground in the Resend dashboard to send a test email to yourself
- That's literally it for your first email — no code needed
Sending emails from code
When you're ready to send emails from your app programmatically:
- Install the library:
npm install resend - In your code:
const resend = new Resend('re_your_key'); - Send:
await resend.emails.send({ from: 'you@yourdomain.com', to: 'user@email.com', subject: 'Welcome!', html: '<p>Thanks for joining!</p>' });
api/ folder).Setting up your domain
By default, Resend can only send emails to you (for testing). To send to real users, you need to verify that you own the email domain you're sending from.
- In the Resend dashboard, go to Domains → Add Domain
- Enter your domain (e.g.,
yourdomain.com) - Resend gives you DNS records to add — these are settings you configure where you bought your domain (like Namecheap, Google Domains, or Cloudflare)
- The records prove to email providers that you're allowed to send from that address
- Once verified (can take minutes to hours), you can send to anyone
Making your emails look good
Plain text emails work fine, but if you want beautiful HTML emails, Resend has a companion library called React Email that lets you design email templates as React components.
- Install:
npm install @react-email/components - Build your email template as a React component (with headings, images, buttons)
- Preview it in your browser while you design
- Pass the component to Resend instead of raw HTML
What does it cost?
- Free tier: 3,000 emails/month and 1 custom domain
- That's plenty for side projects and small apps
- Paid plans start at $20/month for higher volumes
Sign up for Resend, find the API playground in the dashboard, and send a test email to yourself. Read it in your inbox. That's your app's first email.