Skip to main content

Use this pre-built prompt to get started faster.

Open in Cursor

Prerequisites

Before you start, you’ll need:

Guide

1

Install

Get the Resend Node.js SDK.
2

Create an email template

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

Send email using React

The recommended approach is a server function, which runs only on the server and can be called from anywhere in your app. If you’d rather expose a REST endpoint, use a server route instead.Import the React email template and send an email using the react parameter.

Examples

TanStack Start (TypeScript)

Full-stack TanStack Start app with TypeScript

TanStack Start (JavaScript)

Full-stack TanStack Start app with JavaScript

Send Email

Basic email sending

Attachments

Send emails with file attachments

Inline Images (CID)

Embed inline images using CID

Templates

Send emails using Resend hosted templates

Scheduling

Schedule emails for future delivery

Batch Emails

Send multiple emails in a single request

Audiences

Manage contacts and audiences

Domains

Create and manage sending domains

Double Opt-in

Double opt-in subscription flow

Inbound

Receive and process inbound emails

Prevent Threading

Prevent email threading on Gmail

Webhooks

Handle webhook events