Answer the question
In order to leave comments, you need to log in
Missing credentials for "PLAIN"?
let nodemailer = require("nodemailer");
module.exports = function (code) {
// Use Smtp Protocol to send Email
let smtpTransport = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 587,
secure: false,
auth: {
user: '[email protected]',
password: '228password228'
}
});
let mailOptions = {
from: "MyAdmin Helper",
to: "[email protected]",
subject: "Send Email Using Node.js",
text: `${code}`
}
smtpTransport.sendMail(mailOptions, function (error, response) {
if (error) {
console.log(error);
} else {
console.log("Message sent: " + response.message);
}
smtpTransport.close();
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question