Skip to content

nodemailer/nodemailer-cram-md5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRAM-MD5 authentication for Nodemailer

Nodemailer 5+ allows to use custom authentication mechanisms. While there is no support in Nodemailer for CRAM-MD5 then it can be provided with an addon.

Install

Requires Nodejs v8.0.0 or newer

npm install nodemailer-cram-md5

Usage

const nodemailer = require('nodemailer');
const nodemailerCramMd5 = require('nodemailer-cram-md5');

let transporter = nodemailer.createTransport({
    host: 'smtp.example.com',
    port: 465,
    secure: true,
    auth: {
        type: 'custom',
        method: 'CRAM-MD5',
        user: 'username',
        pass: 'verysecret'
    },
    customAuth: {
        'CRAM-MD5': nodemailerCramMd5
    }
});

transporter.sendMail({
    from: '[email protected]',
    to: '[email protected]',
    subject: 'hello world!',
    text: 'hello!'
}, console.log)

About

CRAM-MD authentication addon for Nodemailer

Resources

Stars

Watchers

Forks

Packages

No packages published