npm.io
1.0.7 • Published 5 years ago

blackboard-send-mail

Licence
ISC
Version
1.0.7
Deps
1
Size
3 kB
Vulns
12
Weekly
0

blackboard-send-mail

Send e-mails from Node.js – easy as Peeled bananas!

npm version

NPM

Installation

$ npm install blackboard-send-mail

or

$ yarn add blackboard-send-mail

Importing

// Using Node.js `require()`
const bsm = require('blackboard-send-mail');

Overview

Connecting to Mail

First, we need to define a connection mail service. bsm.connect

bsm.connect({
    host: "HOST_MAIL_DOMAIN",
    auth: {
        user:"EMAIL_DOMAIN",
        pass: "PASSWORD"
    }
})
Send Email
bsm.sendMail({
    from: '"Fred Foo 👻" <foo@example.com>', // sender address
    to: "bar@example.com, baz@example.com", // list of receivers
    subject: "Hello ✔", // Subject line
    text: "Hello world?", // plain text body
    html: "<b>Hello world?</b>", // html body
  }).then(info => {
       console.log("Message sent: %s", info.messageId);
  // Message sent: <b658f8ca-6296-ccf4-8306-87d57a0b4321@example.com>
  });

Keywords