nmailer
v1.0.1
Published
Easy way to send email
Downloads
3
Maintainers
Readme
N-Mailer
Easy way to send emailer by nmailer package. This package using Nodemailer for sending email and Joi for email validation.
Installing
npm install --save nmailer
Usage
First require the nmailer package
const nmailer = require('nmailer');
Setup SMTP configuration
const smtp = 'your-smtp-configuration;
Create object with senderEmail and recieverEmail
const data = {
senderEmailer: 'your-sender-emailer',
recieverEmail: 'your-reciever-email',
}
Craete mail data. Below is the minimal configuration of mail data
const message = {
subject: 'Demo',
text: 'demo mail'
};
At last call the sendEmail function of nmailer.
nmailer.sendEmail(smtp,data,message).then(data => {
console.log('data', data);
}).catch(err => {
console.log('err', err);
})