Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bem-site-mail-sender

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bem-site-mail-sender

E-Mail sending helper. Simple wrapper around nodemailer module

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

mail-sender

E-Mail sending helper. Simple wrapper around nodemailer module

NPM

Coveralls branch Travis David David

Usage

Add mail-sender dependency to your project:

npm install --save bem-site-mail-sender

Add mail-sender requirement to the code of your module:

var sender = require('bem-site-mail-sender').create({
    host: 'smtp.yandex.net', // your smtp e-mail host
    port: 25 // your smtp e-mail port
});

API

sendHtml

For sending e-mails with html body

Arguments:

  • {String} from - e-mail of sender
  • {Array} to - array of recipients e-mails
  • {String} subject of e-mail
  • {String} html body of e-mail
  • {Function} callback function

Example:

sender.sendHtml('from@gmail.com', ['to@gmail.com'], 'Hello World Subject', '<h1>Hello World</h1>', function (err) {
    console.log('done');
});

sendWithAttachments

For sending e-mails with attached file(s)

Arguments:

  • {String} from - e-mail of sender
  • {Array} to - array of recipients e-mails
  • {String} subject of e-mail
  • {String} text body of e-mail
  • {Array} attachments - array of attachment objects
  • {Function} callback function

Example:

var attachments = [{
    filename: 'package.json',
    path: './package.json
}];
sender.sendWithAttachments('from@gmail.com', ['to@gmail.com'],
'Hello World Subject', 'Hello World', attachments, function (err) {
    console.log('done');
});

Testing

Run tests:

npm run mocha

Run tests with istanbul coverage calculation:

npm run istanbul

Run codestyle verification (jshint and jscs)

npm run codestyle

Maintainer @tormozz48 Please send your questions and proposals to: tormozz48@gmail.com

Keywords

FAQs

Package last updated on 31 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc