nodemailer-base64-fix
v1.0.0
Published
A Nodemailer plugin to fix base64 image display issues by converting to CID attachments.
Downloads
3
Readme
nodemailer-base64-fix
A Node.js plugin for Nodemailer that fixes the issue of base64 images not displaying by converting them to CID-based inline attachments.
Installation
npm install nodemailer-base64-fix
Usage
const nodemailer = require('nodemailer');
const base64Fix = require('nodemailer-base64-fix');
let transporter = nodemailer.createTransport({
// your transport options
plugin: base64Fix({
cidPrefix: 'image_'
})
});
let mailOptions = {
from: '[email protected]',
to: '[email protected]',
subject: 'Subject',
html: '<img src="data:image/png;base64,..."> Some content here'
};
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
}
console.log('Message sent: %s', info.messageId);
});