npm.io
1.0.1 • Published 7 years ago

nmailer

Licence
MIT
Version
1.0.1
Deps
2
Size
5 kB
Vulns
9
Weekly
0

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);
})

Keywords