Skip to content

Instantly share code, notes, and snippets.

@anthonyjdella
Created March 21, 2018 01:48
Show Gist options
  • Save anthonyjdella/4f4ab47212bf1ed085a1dc8215401cb7 to your computer and use it in GitHub Desktop.
Save anthonyjdella/4f4ab47212bf1ed085a1dc8215401cb7 to your computer and use it in GitHub Desktop.
const transporter = nodemailer.createTransport(smtpTransport({
service: 'Gmail',
host: 'smtp.gmail.com',
port: 465,
auth: {
user: credentials.email,
pass: credentials.password
}
}));
transporter.sendMail({
from: credentials.email,
subject: "State Farm Jobs",
text: "Hey, here are the job searches:",
attachments: [
{
'filename': 'state-farm-jobs.txt',
'path': 'C:/Users/Anthony/Documents/git/automated-job-web-scraping/state-farm-jobs.txt'
}
],
to: credentials.email
}, function (error, info) {
if (error) {
return console.log(error);
}
console.log('Message %s sent: %s', info.messageId, info.response);
console.log("E-Mail sent successfully to " + credentials.email);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment