错误我在快递js中使用nodemailer,如何解决?
app.post(' / feedback',function(req,res){ const transporter = nodemailer.createTransport({ 服务:' Gmail', auth:{ 用户:' kdsingh834@gmail.com', 传递:'' } });
var mailOptions = {
from: 'kd <kdsingh834@gmail.com>'
to: 'kdsinghjob@gmail.com',
subject: 'feedback submission',
text: 'your submission with details..Name: '+req.body.name+'Email:'+req.body.email+ 'Message: '+req.body.message,
html: '<p>your submission with details..</p><ul><li>Name: '+req.body.name+'</li><li>Email: '+req.body.email+'</li><li>Message: '+req.body.message+'</li></ul>'
};
transporter.sendMail(mailOptions, function(error, info){
if(error){
console.log(error);
res.redirect('/');
} else {
console.log('Message sent: '+info.response);
res.redirect('/');
}
});
});