Nodemailer
Email sending library for Node.js using SMTP, SES, or other transports. Nodemailer handles email composition (HTML/text, attachments, inline images, calendar events) and transport (SMTP, AWS SES, Sendmail). The standard Node.js library for email — used before transactional email APIs existed and still relevant for custom SMTP configurations, self-hosted mail, or when avoiding external email APIs.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
SMTP credentials must be in environment variables — never hardcoded. TLS support for SMTP connections. OAuth2 for Gmail is more secure than app passwords.
⚡ Reliability
Best When
You need SMTP-based email sending from Node.js and either have an existing SMTP server, want to self-host, or use AWS SES without an API wrapper.
Avoid When
You need managed email deliverability, email analytics, or template management — transactional email APIs (Resend, Postmark) offer more value.
Use Cases
- • Send transactional emails (password reset, notifications) from Node.js servers using SMTP or SES transport
- • Send emails with attachments (PDFs, reports, exports) from agent automation workflows
- • Test email sending in development with Nodemailer's test account (Ethereal) or Mailhog/Mailpit local dev servers
- • Build email sending without external email API dependencies — use existing SMTP server or self-hosted Postfix
- • Send calendar invites (.ics files) via email in Node.js agent scheduling workflows
Not For
- • Marketing email campaigns — use Mailchimp or Brevo for bulk/marketing email
- • Transactional email with advanced deliverability — Resend, Postmark, or SendGrid have better deliverability infrastructure
- • HTML email template rendering — combine with MJML or React Email for template generation
Interface
Authentication
SMTP auth (username/password), OAuth2 for Gmail, or no-auth for relay servers. AWS SES integration uses AWS credentials.
Pricing
MIT-licensed open source library. Email costs depend on SMTP provider used.
Agent Metadata
Known Gotchas
- ⚠ Gmail OAuth2 setup is complex — modern Gmail blocks basic SMTP auth; require OAuth2 configuration or use Google Workspace SMTP relay instead of personal Gmail
- ⚠ SMTP connection reuse with pool: true reduces overhead for bulk sending — without pooling, each send opens a new TCP connection which is slow for many emails
- ⚠ Attachments passed as Buffer or path — strings are NOT auto-converted; always pass content as Buffer or file path
- ⚠ HTML email rendering requires explicit 'html' option — setting only 'text' sends plain-text only; set both for proper fallback
- ⚠ SES transport is in @aws-sdk/client-ses wrapper — the official nodemailer-transport-ses is deprecated; use @aws-sdk/client-ses directly with Nodemailer's SES adapter
- ⚠ Test accounts via nodemailer.createTestAccount() use Ethereal — good for CI testing to see rendered emails; don't use Ethereal in production
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Nodemailer.
Scores are editorial opinions as of 2026-03-06.