我想通过nodemailer发送电子邮件后,使用HTML显示确认消息。我对节点相当陌生,所以我不确定是否缺少明显的东西。Node.js使用回调函数更改HTML代码
app.post("/bye", function(req, res){
// send e-mail
var transporter = nodemailer.createTransport({
...
});
var mailOptions = {
...
}
transporter.sendMail(mailOptions, function(error, info){
if(error){
return console.log(error);
}
console.log('Message sent: ' + info.response);
... (Something here that is going to print a confirmation message to the html code of the page)
});
res.end("yes");
});
感谢