@hafdon/sendmail
v1.0.0
Published
a wrapper around nodemailer which handles the transporter for you
Downloads
4
Readme
@hafdon/sendmail
a wrapper around nodemailer which handles the transporter for you
install
npm i @hafdon/sendmail
use
const {configure, sendmail} = require('@hafdon/sendmail')
const options = require('./optionsfile.js')
async function main() {
configure(options)
const mailresult = await sendmail({
to : '[email protected]',
from: '[email protected]',
subject: 'a mail',
text | html : 'text here'
})
}
main()
format of configuration file:
// example
{
host: 'smtp.gmail.com',
port: 587,
secure: false, // true for 465, false for other ports
auth: {
user : '<username>',
pass : '<password>',
},
}