Last active
November 6, 2018 21:31
-
-
Save anonymous/120fd2dfc023c488b7824cbb60389bb3 to your computer and use it in GitHub Desktop.
Mailjet and nodemailer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let transporter = nodemailer.createTransport({ | |
service: 'Mailjet', | |
auth: { | |
user: '[LONG STRING FOR MY USER NAME FROM MAILJET]', | |
pass: '[LONG STRING FOR MY PASSWORD FROM MAILJET]' | |
} | |
}); | |
let mailOptions = { | |
from: '"Fred Foo 👻" <foo@blurdybloop.com>', // sender address | |
to: '[MY EMAIL TO TEST]', // list of receivers | |
subject: 'Hello ✔', // Subject line | |
text: 'Hello world ?', // plain text body | |
html: '<b>Hello world ?</b>' // html body | |
}; | |
return transporter.sendMail(mailOptions, (error, info) => { | |
if (error) { | |
return console.log(error); | |
} | |
console.log('Message %s sent: %s', info.messageId, info.response); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment