它给出了语法错误。这是在nodejs中声明html的正确格式。我尝试了所有的事情,比如分别创建变量,然后只是告诉我相同的错误。
let mailOptions = {
from: 'wwwwwww@domain.com',
to: 'wwwwwwwww@domain.com',
subject: 'mail notification Test',
html:<html>
<head>
<style>
table, th, td=
border: 1px solid black;
border-collapse: collapse;
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th>Id</th>
<th>Templatename</th>
<th>Description</th>
<th>TemplateContent</th>
<th>Activestate</th>
</tr>
<tr>
<td>streamingTemplate.id.toString().toLowerCase()</td>
<td>streamingTemplate.is_active.toString().toLowerCase()</td>
<td></td>
</tr>
</table>
</body>
</html>
};
答案 0 :(得分:0)
你需要引用像这样的HTML代码
let mailOptions = {
from: '"Fred Foo" <foo@blurdybloop.com>', // sender address
to: 'bar@blurdybloop.com, baz@blurdybloop.com', // list of receivers
subject: 'Hello', // Subject line
text: 'Hello world ?', // plain text body
html: '<b>Hello world ?</b>' // html body
};