2.1.2 • Published 4 years ago

mailbuilder v2.1.2

Weekly downloads
242
License
MIT
Repository
github
Last release
4 years ago

mailbuilder

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: 'john@doe.com' },
  to: [{ name: 'Вася Пупкин', address: 'vasya@pupkin.com' }],
  bcc: [
    { name: 'One Spy', address: 'spy@kremlin.ru' },
    { name: 'Big Eye', address: 'fbi@whitehouse.org' },
  ],
  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);

/**

res:
From: \\"John \\\\\\"Cool\\\\\\" Doe\\" <john@doe.com>
To: =?utf-8?B?0JLQsNGB0Y8g0J/Rg9C/0LrQuNC9IDx2YXN5YUBwdXBraW4uY29tPg==?=
Content-Type: text/html; charset=utf-8
MIME-Version: 1.0
Bcc: One Spy <spy@kremlin.ru>, Big Eye <fbi@whitehouse.org>
Subject: =?utf-8?B?U29tZSDwn5KEIHN1YmplY3Q=?=

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

**/

License

MIT licensed by Konstantin Vyatkin tino@vtkn.io

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.0

5 years ago

1.0.0

6 years ago

0.0.1

6 years ago