sanmailer

2.1.0 • Public • Published

sanmailer

nodemailer and email simple adapter

NPM Version NPM Downloads

Settings

$ npm install sanmailer 

If you have Sendmail installed you don't need settings

var mailer = require('sanmailer').local();

With host settings:

var mailerConf = {
  host: 'some.valid.host.com',
  port: 587,
  debug: false,
  auth: {
    user: 'username',
    pass: 'password'
  }  
};
...
var mailer = require('sanmailer').host(mailerConf);

Use

You have two methods

sendMail

mailer.sendMail(
  '<from@mail.com>',
  'to@mail.com',
  'Subject',
  'body',
  {
    //optative fields
    replyTo: ['mail1@mail.com', 'mail2@mail.com'],
    cc: []
  },
  function(error, info){
    //handle
  }
);

checkMail

if(mailer.checkEmail(req.body.sEmail)){
  //do stuf  
}

Dependencies (3)

Dev Dependencies (1)

Package Sidebar

Install

npm i sanmailer

Weekly Downloads

0

Version

2.1.0

License

MIT

Last publish

Collaborators

  • sanjorgek