Skip to content

mochnatiy/nodemailer-smime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodemailer plugin to sign mail using S/MIME

Build Status Coverage Status Greenkeeper badge dependencies Status devDependencies Status

This plugin signs mail using an S/MIME certificate. Many mail agents are able to decode these in order to prove the identity of the sender.

Install

Install from npm

npm install nodemailer-smime --save

Usage

Load the nodemailer-smime plugin

const smime = require('nodemailer-smime');

Attach it as a 'stream' handler for a nodemailer transport object

transporter.use('stream', htmlToText(options));

Options

  • cert - PEM formatted SMIME certificate to sign/bundle mail with
  • chain - array of PEM formatted certificates to bundle
  • key - PEM formatted private key associated with certificate

Example

const nodemailer = require('nodemailer');
const smime = require('nodemailer-smime');
const transporter = nodemailer.createTransport();
const options = {
    cert: '<PEM formatted cert>',
    chain: [
      '<PEM formatted cert>'
    ],
    key: '<PEM formatted key>'
}
transporter.use('stream', smime(options));
transporter.sendMail({
    from: '[email protected]',
    to: '[email protected]',
    html: '<b>Hello world!</b>'
});

License

MIT

About

Sign Nodemailer mail using S/MIME

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%