Prompt
email API for Node.js
Latest observation
Sep 24, 2026
OpenAI APIWeb search: off
If you want an email API for Node.js, the best options depend on whether you want to send emails, receive emails, or both.
Common choices
1. SendGrid
Good for transactional emails, marketing, and good deliverability.
npm install @sendgrid/mail
import sgMail from '@sendgrid/mail';
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
const msg = {
to: 'user@example.com',
from: 'you@yourdomain.com',
subject: 'Hello from Node.js',
text: 'This is a test email',
html: '<strong>This is a test email</strong>',
};
await sgMail.send(msg);
2. Nodemailer
Best if you want to send via SMTP and keep it simple.
npm install nodemailer
import nodemailer from 'nodemailer';
const transporter = nodemailer.createTransport({
host: 'smtp.example.com',
port: 587,
secure: false,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
},
});
await transporter.sendMail({
from: '"Your App" <no-reply@yourdomain.com>',
to: 'user@example.com',
subject: 'Hello',
text: 'Test email',
html: '<b>Test email</b>',
});
3. Resend
Very simple API for modern apps.
npm install resend
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: 'Your App <onboarding@yourdomain.com>',
to: 'user@example.com',
subject: 'Hello',
html: '<p>This is a test email</p>',
});
Which one should you use?
- Need SMTP support? →
nodemailer - Need easiest modern email API? →
resend - Need scalable production email delivery? →
sendgrid
If you want, I can give you:
- a full Node.js email example
- a Node.js Express email endpoint
- a comparison table of email APIs
Brands