Skip to content

Instantly share code, notes, and snippets.

@Anshul0305
Last active February 17, 2023 14:51
Show Gist options
  • Save Anshul0305/761ff55d478621becf83a7eef6d1ac61 to your computer and use it in GitHub Desktop.
Save Anshul0305/761ff55d478621becf83a7eef6d1ac61 to your computer and use it in GitHub Desktop.
How to send emails from Dialogflow
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);
}
});
@diku1968
Copy link

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment