Boring Docs
Emails — Resend Delivery & Magic Links
Zero-dependency Resend REST client, NextAuth magic links, and verified domains.
In this guide
Emails
Send (Transactional)
libs/resend.js:sendEmail({ to, subject, text, html, replyTo, from }) — delivers emails directly via the Resend REST API (https://api.resend.com/emails) using native fetch. Zero external npm dependencies.
Reads RESEND_API_KEY (or extracts the key from EMAIL_SERVER). From address defaults to RESEND_FROM or config.resend.fromAdmin (Boring <[email protected]>).
import { sendEmail } from "@/libs/resend";
await sendEmail({
to: "[email protected]",
subject: "Your receipt",
html: "<p>Thank you for your order!</p>",
});
Magic links (NextAuth)
Email sign-in (EmailProvider in libs/next-auth.js) sends magic links via Resend:
- Set
EMAIL_SERVER=smtp://resend:[email protected]:465 - Set
RESEND_FROM=Boring <[email protected]>(or your verified custom domain)
Uses per-DB adapters' verification-token tables with identical UX on SQLite, MongoDB, and Supabase.
Test CLI
Verify your Resend setup in one command:
node scripts/test-email.js [email protected]