1.3.7-miry.10.2 • Published 1 year ago

@miry/nodemailer-smime-plus v1.3.7-miry.10.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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 @miry/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: '/path/to/your/certificate.p12', // Path to the PKCS#12 file
  key: 'your_password', // Passphrase for the PKCS#12 file
};

// Use the S/MIME plugin
transporter.use('stream', smime(options));

Options

  • cert - Path to the PKCS#12 file containing the SMIME certificate used to sign/bundle the mail
  • key - Passphrase for the PKCS#12 file

Example

import nodemailer from 'nodemailer';
import smime from '@miry/nodemailer-smime-plus';

const transporter = nodemailer.createTransport();

const options = {
  cert: '/path/to/your/certificate.p12', // Path to the PKCS#12 file
  key: 'your_password', // Passphrase for the PKCS#12 file
};

// Use the S/MIME plugin
transporter.use('stream', smime(options));

transporter.sendMail({
  from: 'me@example.com',
  to: 'receiver@example.com',
  html: '<b>Hello world!</b>'
}, (error, info) => {
  if (error) {
    return console.error('Error sending email:', error);
  }
  console.log('Email sent:', info.response);
});

License

MIT

1.3.7-miry.10.5

1 year ago

1.3.7-miry.10.4

1 year ago

1.3.7-miry.10.3

1 year ago

1.3.7-miry.10.2

1 year ago

1.3.7-miry.10.1

1 year ago

1.3.7-miry.10.0

1 year ago

1.3.7-miry.9.1

1 year ago

1.3.7-miry.9

1 year ago

1.3.7-miry.8

1 year ago

1.3.7-miry.7

1 year ago

1.3.7-miry.6

1 year ago

1.3.7-miry.5.2

1 year ago

1.3.7-miry.5.1

1 year ago

1.3.7-miry.5

1 year ago

1.3.7-miry.4

1 year ago

1.3.7-miry.3

1 year ago

1.3.7-miry.2

1 year ago

1.3.7-miry.1

1 year ago

1.3.7-miry

1 year ago