在nodemailer中,如何格式化文本邮件正文

我在nodemailer中有文本主体。 我想在电子邮件中格式化文本。

var mailOptions={ to : data.toAddress, cc : data.ccAddress, bcc : data.bccAddress, subject : data.subject, text : data.message } smtpTransport.sendMail(mailOptions, function(error, response){ if(error){ callback(null, error); }else{ callback(response); } }); 

例如; inculde子弹风格,大胆的具体词。

但在文档中我没有find具体的部分。

请让我知道是否有任何想法。

如果你想在电子邮件中格式化文本,你必须使用HTML语法来编写这个文本。

 var message = "<p style='font-weight:bold;'> Hi. My name is John </p>"; var mailOptions={ to : data.toAddress, cc : data.ccAddress, bcc : data.bccAddress, subject : data.subject, text : message } smtpTransport.sendMail(mailOptions, function(error, response){ if(error){ callback(null, error); }else{ callback(response); } });