syntax-mail
v0.3.0
Published
simple mail sending with syntax-mail api
Downloads
5
Readme
syntax-mail
simple mail sending with syntax-mail api
installation
npm i syntax-mail # --save
usage
const SyntaxMail = require('syntax-mail');
// new SyntaxMail(username, password);
const api = new SyntaxMail('[email protected]', 'smtp-api-sdk');
// to and body is required mail property
const mail = {
// addressee or array of addressee
to: '[email protected]', // ['[email protected]', '[email protected]', '[email protected]'],
body: 'syntax hello',
// subject: '',
// content_type: 'text/html',
// as: '',
};
api
.send(mail)
.then(res => console.log(res))
.catch(reason => console.log(reason));
// {"status":200,"message":"Sent."}
// or [{"status":200,"message":"Sent."}, {"status":200,"message":"Sent."}]
// also we can pass node style cb as second argument
api.send(mail, function(err, res) {
console.log(err ? err : res);
});