Last active
February 17, 2023 14:51
-
-
Save Anshul0305/761ff55d478621becf83a7eef6d1ac61 to your computer and use it in GitHub Desktop.
How to send emails from Dialogflow
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 nodemailer = require("nodemailer"); | |
const transporter = nodemailer.createTransport({ | |
service: 'gmail', | |
auth: { | |
user: 'YOUR_GMAIL_ID', | |
pass: 'YOUR_GMAIL_PASSWORD' | |
} | |
}); | |
const mailOptions = { | |
from: "FROM_NAME", // sender address | |
to: "TO_EMAIL", // list of receivers | |
subject: "EMAIL_SUBJECT", // Subject line | |
html: "<p> EMAIL_HTML_BODY </p>" | |
}; | |
transporter.sendMail(mailOptions, function (err, info) { | |
if(err) | |
{ | |
console.log(err); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice