blackboard-send-mail
v1.0.7
Published
Send e-mails from Node.js β easy as Peeled bananas! πβοΈ
Downloads
13
Maintainers
Readme
blackboard-send-mail
Send e-mails from Node.js β easy as Peeled bananas! πβοΈ
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 π»" <[email protected]>', // sender address
to: "[email protected], [email protected]", // 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: <[email protected]>
});