Skip to main content

Extra modules

In addition to Nodemailer itself, several companion libraries extend what you can do with email in Node.js. These tools help you receive incoming mail, compose messages programmatically, parse raw email content, and preview emails during development.

Official companion libraries

These packages are maintained by the Nodemailer team and designed to work seamlessly with Nodemailer.

  1. smtp-server - Build your own SMTP server to accept incoming email connections. Useful for creating custom mail servers, testing email workflows, or building email-receiving applications.
  2. smtp-connection - A low-level SMTP client for establishing connections to mail servers. This is the underlying component that powers Nodemailer's SMTP transport, exposed separately for advanced use cases where you need direct control over the SMTP protocol.
  3. mailparser - Parse raw email messages (RFC 822 format) into structured JavaScript objects. The streaming parser efficiently handles large emails and extracts headers, body content, and attachments into an easy-to-use format.
  4. mailcomposer - Generate RFC 822-compliant email messages from JavaScript objects. This is useful when you need to create a properly formatted MIME message without sending it immediately, such as for storing drafts or passing to another system.

From the Nodemailer team

These projects are built and maintained by the same team as Nodemailer.

  1. EmailEngine - A self-hosted email API that turns any Gmail, Microsoft 365, or IMAP account into a REST endpoint. It handles OAuth2 and token refresh, sends email via SMTP, and delivers real-time updates through webhooks. EmailEngine is commercial, source-available software, and its licenses sustain Nodemailer development.
  2. ImapFlow - A modern, Promise-based IMAP client for Node.js. Built as the IMAP engine for EmailEngine, it works as a standalone library for reading and managing emails on any IMAP server.
  3. mailauth - A comprehensive library for email authentication. It validates and generates SPF, DKIM, DMARC, ARC, and BIMI records, helping you verify email authenticity and improve deliverability.

Community projects

These independent open-source projects complement Nodemailer and may be helpful depending on your use case.

  1. email-templates - A complete framework for managing email templates. It supports template rendering, preview in browsers and iOS Simulator, and integrates directly with Nodemailer for sending.
  2. preview-email - A development tool that automatically opens emails in your browser for preview. It works with Nodemailer to help you inspect and debug email content before sending to real recipients.

note

smtp-connection and mailcomposer ship inside the Nodemailer package itself, so they are always in sync with your installed Nodemailer version. smtp-server and mailparser are separate packages maintained in the Nodemailer GitHub organization with their own release cycles. EmailEngine, ImapFlow, and mailauth come from the same team; EmailEngine is commercial, source-available software, while the others are open source. email-templates and preview-email are maintained by the broader open-source community.