node-sap-mailer

0.3.1 • Public • Published

Build Version Dependency Status devDependency Status Coverage node-sap-mailer

This service gives the ability to easily send emails. This service is based on Nodemailer node package.

Nodemailer transport options

//./config.js
module.exports = {
     host: "mail.example.com",
      port: 25,
      debug: true,
      tls: {
        rejectUnauthorized: false
    }
};

How to use Mailer service in module

//./config.js
var Mailer = require('norman-common-server').Mailer;
Mailer.sender = 'no-reply@mail.example.com';
mailer.send(mailOptions, function onError(error) {
    console.log('Error', error);
}, function onSuccess(info) {
   console.log('Success', info);
});

mailOptions:

// setup an e-mail
var mailOptions = {
    from: 'foo@mail.example.com', // sender address
    to: 'bar@mail.example.com, baz@mail.example.com', // list of receivers
    subject: 'Hello', // Subject line
    text: 'Hello world', // plaintext body
    html: '<b>Hello world</b>' // html body
};

For more please see the https://github.com/andris9/Nodemailer example for mailOptions.

Readme

Keywords

none

Package Sidebar

Install

npm i node-sap-mailer

Weekly Downloads

2

Version

0.3.1

License

none

Last publish

Collaborators

  • davidjones02
  • devinea
  • donal-tobin-sap
  • ianquigley-sap
  • jlongieirl