Prompt
email API for Vercel
Latest observation
Sep 24, 2026
OpenAI APIWeb search: off
If you want to send email from a Vercel app, the most common options are:
1) Vercel + Resend
This is probably the easiest setup for Next.js on Vercel.
Install
npm install resend
API route example
// app/api/send-email/route.js
import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_API_KEY);
export async function POST(req) {
const { to, subject, text } = await req.json();
try {
const data = await resend.emails.send({
from: "Your App <onboarding@resend.dev>",
to,
subject,
text,
});
return Response.json({ success: true, data });
} catch (error) {
return Response.json({ success: false, error: error.message }, { status: 500 });
}
}
Env var
RESEND_API_KEY=your_key_here
2) Vercel + SendGrid
Good for more traditional email delivery.
Install
npm install @sendgrid/mail
Example
import sgMail from "@sendgrid/mail";
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
export async function POST(req) {
const { to, subject, text } = await req.json();
try {
await sgMail.send({
from: "your-verified-sender@example.com",
to,
subject,
text,
});
return Response.json({ success: true });
} catch (error) {
return Response.json({ success: false, error: error.message }, { status: 500 });
}
}
3) Vercel + Postmark
Very reliable for transactional email.
4) Vercel + Nodemailer + SMTP
Works if you already have an SMTP provider, but less ideal for serverless than dedicated email APIs.
Recommendation
For most Vercel/Next.js apps:
- Resend = easiest and modern
- SendGrid = flexible and widely used
- Postmark = best for transactional deliverability
If you want, I can give you:
- a complete Next.js API route for Vercel,
- a React form that sends the email, or
- the best email provider comparison for Vercel.