Skip to main content

Use this pre-built prompt to get started faster.

Open in Cursor

Prerequisites

Before you start, you’ll need: Prefer watching a video? Check out our video walkthrough below.

Guide

1

Install

Get the Resend Node.js SDK.
2

Create an email template

Start by creating your email template on components/email-template.tsx.
components/email-template.tsx
3

Send email using React

Create a route file under app/api/send/route.ts (or pages/api/send.ts if you’re using Pages Router).Import the React email template and send an email using the react parameter.

Examples

Next.js (TypeScript)

Full-stack Next.js app with TypeScript

Next.js (JavaScript)

Full-stack Next.js app with JavaScript

Attachments

Send emails with file attachments

React Email

Send emails with React Email components

Templates

Send emails using Resend hosted templates

Scheduling

Schedule emails for future delivery

Double Opt-in

Double opt-in subscription flow

Inbound Webhooks

Receive and process inbound emails

Prevent Threading

Prevent email threading on Gmail

Audiences

Manage contacts and audiences

Domains

Create and manage sending domains

Better Auth

Email authentication with Better Auth