nodemailer-smime-plus
v1.3.7
Published
Up-to-date nodemailer-smime fork
Downloads
1,344
Readme
Nodemailer plugin to sign mail using S/MIME
This is an up-to-date version of the original nodemailer-smime package.
Install
Install from npm
npm install nodemailer-smime-plus --save
Usage
Load the nodemailer-smime-plus
plugin
import smime from 'nodemailer-smime-plus';
Attach it as a 'stream' handler for a nodemailer transport object
const options = {
cert: '<PEM formatted cert>',
chain: [
'<PEM formatted cert>',
],
key: '<PEM formatted key>',
};
transporter.use('stream', smime(options));
Options
cert
- PEM formatted SMIME certificate to sign/bundle mail withchain
- array of PEM formatted certificates to bundlekey
- PEM formatted private key associated with certificate
Example
import nodemailer from 'nodemailer';
import smime from 'nodemailer-smime-plus';
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