Created
March 21, 2018 01:48
-
-
Save anthonyjdella/4f4ab47212bf1ed085a1dc8215401cb7 to your computer and use it in GitHub Desktop.
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
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