我想通過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");
});
感謝