Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
mailgun-nodemailer-transport
Advanced tools
Mailgun API V3 and Nodemailer v4+. The plugin is very small, optimized and written in TypeScript
The custom transport plugin that allows to send email using Nodemailer via Mailgun
Created for the new v3 Mailgun API and Nodemailer v4+. The plugin is very small, optimized and written in TypeScript
If you like to use this module please click the star button - it is very motivating.
Install mailgun-nodemailer-transport using npm:
$ npm install mailgun-nodemailer-transport --save
Nodemailer common fields are supported and replyTo
send simple email
'use strict';
const nodemailer = require('nodemailer');
const MailgunTransport = require('mailgun-nodemailer-transport');
let transporter = nodemailer.createTransport(new MailgunTransport({
auth: {
domain: 'your domain name https://app.mailgun.com/app/domains',
apiKey: '12124124124124-key-test'
}
}));
transporter.sendMail({
from: 'email@example.com',
to: 'recipient@test.com',
replyTo: 'reply-to@example.com',
subject: 'Mailgun Transport',
text: 'This is text content'
}).then((info) => {
console.log('SUCCESS');
}).catch((error) => {
console.log('Something is wrong');
});
send attachment and add to content
'use strict';
const nodemailer = require('nodemailer');
const MailgunTransport = require('mailgun-nodemailer-transport');
let transporter = nodemailer.createTransport(new MailgunTransport({
auth: {
domain: 'your domain name https://app.mailgun.com/app/domains',
apiKey: '12124124124124-key-test'
}
}));
transporter.sendMail({
from: 'email@example.com',
to: 'recipient@test.com',
replyTo: 'reply-to@example.com',
subject: 'Mailgun Transport',
html: '<!DOCTYPE html><html><body><img src="cid:attachment" alt="attachment"></body></html>',
attachments: [{
content: '/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAA...', // base64 content
cid: 'attachment',
contentType: 'image/jpeg',
filename: 'attachment.jpg',
encoding: 'base64'
}]
}).then((info) => {
console.log('SUCCESS');
}).catch((error) => {
console.log('Something is wrong');
});
FAQs
Mailgun API V3 and Nodemailer v4+. The plugin is very small, optimized and written in TypeScript
The npm package mailgun-nodemailer-transport receives a total of 2,396 weekly downloads. As such, mailgun-nodemailer-transport popularity was classified as popular.
We found that mailgun-nodemailer-transport demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.