Prompt
I'm building a Next.js app and want to avoid maintaining SMTP infrastructure.
Latest observation
Sep 24, 2026
OpenAI APIWeb search: off
A good approach is to use a transactional email API instead of running your own SMTP server.
For a Next.js app, common options are:
- Resend — very popular with Next.js, simple API, good developer experience
- Postmark — reliable for transactional mail, strong deliverability
- SendGrid — widely used, more features, a bit heavier
- Mailgun — flexible and established
- AWS SES — cheapest at scale, but more setup
Recommended stack for Next.js
If you want the simplest path, I’d suggest:
- Resend for sending email
- Next.js API route / server action for triggering sends
- Domain verification + SPF/DKIM for deliverability
Why this is better than SMTP
- No server to maintain
- Easier authentication with API keys
- Better deliverability tools
- Simpler error handling and logging
- Often easier to integrate with serverless Next.js deployments
Example with Resend
// app/api/send-email/route.ts
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY!);
export async function POST() {
await resend.emails.send({
from: 'Your App <noreply@yourdomain.com>',
to: 'user@example.com',
subject: 'Welcome!',
html: '<p>Hello from Next.js</p>',
});
return Response.json({ ok: true });
}
Things to keep in mind
- Don’t send email from client-side code
- Store API keys in env vars
- Verify your sending domain
- Set up a custom
fromaddress
If you want, I can recommend the best provider based on your needs:
- lowest cost
- easiest setup
- best deliverability
- best for marketing emails vs transactional emails