Node.JS module for generating e-mail messages that can be streamed to SMTP or GMail raw API

Usage no npm install needed!

<script type="module">
  import mailbuilder from '';



Simplified email message composition library for Node.js

npm codecov node Typed with TypeScript

This is simple library (no dependencies) to generate HTML-only email messages (without attachments) from given parameters. Supports Unicode for names and subject, but encodes only when it's actually required:

const { simpleHtmlEmail } = require('mailbuilder');

const testMsg = {
  from: { name: 'John "Cool" Doe', address: '' },
  to: [{ name: 'Вася Пупкин', address: '' }],
  bcc: [
    { name: 'One Spy', address: '' },
    { name: 'Big Eye', address: '' },
  subject: 'Some 💄 subject',
  html: `This is our <b>html</b> message content
      It's also <i>multiline</i> just in case`,
const res = simpleHtmlEmail(testMsg);


From: \\"John \\\\\\"Cool\\\\\\" Doe\\" <>
To: =?utf-8?B?0JLQsNGB0Y8g0J/Rg9C/0LrQuNC9IDx2YXN5YUBwdXBraW4uY29tPg==?=
Content-Type: text/html; charset=utf-8
MIME-Version: 1.0
Bcc: One Spy <>, Big Eye <>
Subject: =?utf-8?B?U29tZSDwn5KEIHN1YmplY3Q=?=

This is our <b>html</b> message content
      It's also <i>multiline</i> just in case"



MIT licensed by Konstantin Vyatkin