1.0.2 • Published 6 years ago
knode-mailer v1.0.2
knode-mailer
is a simple node module wrapper on nodemailer
.
Install:
npm install --save knode-mailer
Usage:
Config sample
mailer:
service: 'SES-EU-WEST-1'
from: 'sender <sender@bender.com>'
auth:
user: process.env.MAILER_USER
pass: process.env.MAILER_PASS
JS sample
var mailer = require('knode-mailer')(config); //config should hold all the settings as shown above
var htmlContent = false;
var attachments = [{filename: 'image.jpg',path: '/path/to/image.jpg'}];
mailer.send('recipient@domain.com', 'subject', 'message body', htmlContent, attachments, function(err, info) {
if (err) {
console.log("ERROR: " + err);
}
return console.log(info);
});