Last active
March 27, 2017 22:37
-
-
Save JonathanZWhite/6e7bd8dc44ef6da2e14e9340be779c71 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var nodemailer = require('nodemailer'); | |
const subscribe = { | |
send: function(name, service) { | |
const transporter = nodemailer.createTransport({ | |
service: 'Gmail', | |
auth: { | |
user: 'your gmail username', | |
pass: 'your gmail password' | |
}, | |
}, { | |
from: 'Sender Name <[email protected]>', | |
}); | |
const message = { | |
to: '"Your name" <[email protected]>', | |
subject: 'Some subject line', | |
text: 'This is the body of your email. Use string concat to add variables in here', | |
}; | |
transporter.sendMail(message, function (error, info) { | |
if (error) { | |
console.log('Err', error.message); | |
return; | |
} | |
console.log('Message sent successfully 🔥'); | |
}); | |
}, | |
} | |
module.exports = subscribe; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment