Skip to content

Instantly share code, notes, and snippets.

@rimiti

rimiti/index.js

Last active Aug 20, 2019
Embed
What would you like to do?
Sending an email with Mandrill
const nodemailer = require("nodemailer");
const mandrillTransport = require('nodemailer-mandrill-transport');
const smtpTransport = nodemailer.createTransport(mandrillTransport({
auth: {
apiKey : 'your-token'
}
}));
const mailData = {
from : 'dimitri.dobairro@dimsolution.com',
to : 'test@gmail.com',
subject : "Test",
html : "Hello<br> How are you doing?"
};
smtpTransport.sendMail(mailData, function(error, response){
if(error) {
throw new Error("Error in sending email");
}
console.log("Message sent: " + JSON.stringify(response));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.