Created
June 21, 2019 11:59
-
-
Save phenomnomnominal/29447a79f0c2fd73130542370e2a202b 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
const nodemailer = require('nodemailer'); | |
const transporter = nodemailer.createTransport({ | |
service: 'gmail', | |
auth: { | |
user: process.env.SENDER_EMAIL, | |
pass: process.env.SENDER_PASSWORD | |
} | |
}); | |
async function sendEmail (info) { | |
try { | |
await transporter.sendMail({ | |
from: '"BIOMETRICS APPOINTMENT FINDER π" <[email protected]>', | |
to: '[email protected]', | |
subject: info, | |
text: info, | |
html: `<b>${info}</b>` | |
}); | |
console.log('πΈπͺπ Info: Sent email'); | |
} catch (error) { | |
console.error('πΈπͺπ Error:', error); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment