nodemailer-promisify
v1.0.2
Published
A promisified class for nodemailer lib:
Downloads
2
Readme
nodemailer-promisify
A promisified class for nodemailer lib:
https://nodemailer.com
Installation
npm i nodemailer-promisify --save
Examples
// Create Instance
const { Nodemailer } = require('nodemailer-promisify');
(async() => {
// Test account
account = await Nodemailer.CreateTestAccount();
mailer = await new Nodemailer({
host: 'smtp.ethereal.email', // 'smtp.gmail.com' for gmail
port: 587,
secure: false,
auth: {
user: account.user, // your acc
pass: account.pass, // password
}
});
// Send mail
const mailOptions = {
from: '"Fred Foo" <[email protected]>',
to: '[email protected], [email protected]',
bcc: '[email protected], [email protected]',
subject: 'Hello',
text: 'Hello world?',
html: '<b>Hello world?</b>'
};
const info = await mailer.Send(mailOptions);
// Email preview, for test acc mode only
console.log(Nodemailer.GetTestMessageUrl(info));
})();
Test
npm test