Html 如何格式化Angular 8生成的电子邮件内容

Html 如何格式化Angular 8生成的电子邮件内容,html,angular,Html,Angular,我已经用Angular 8在我的网站上创建了一个联系人表单,我需要格式化生成的电子邮件 // send the message and get a callback with an error or details of the message that was sent server.send({ text: 'Order details:\n First Name: ' + req.firstName + '\n Last

我已经用Angular 8在我的网站上创建了一个联系人表单,我需要格式化生成的电子邮件

// send the message and get a callback with an error or details of the message that was sent
    server.send({
      text:   
      'Order details:\n First Name: ' + req.firstName +
                '\n Last Name: ' + req.lastName +
                '\n Email: ' + req.email +
                '\n Phone: ' + req.phone +
                '\n Notification: ' + req.notification +
                '\n Order Types: ' + req.orderType1 + ', '  + req.orderType2 + ', ' + req.orderType3 + ', ' + req.orderType4 +
                '\n Servings: ' + req.servings +
                '\n Occassion: ' + req.occassion +
                '\n Date of Occassion ' + req.dateOfOccassion +
                '\n Date of Application ' + req.dateOfApplication +
                '\n Theme: ' + req.theme,
      from:    "XXXXXXXXXXXXXXXXXX",
      to:      "XXXXXXXXXXXXXXXXXX",
      cc:       req.email,
      subject: "testing emailjs"
    }, function(err, message) {
      if(err) {
        console.log(err || message);
      } else {
        return console.log('email was sent successfully');
      }
    });

这是消息格式,但是我需要添加HTML标记以正确设置其样式。最好的方法是什么?

您可以在电子邮件的邮件正文中添加HTML标记。但是请确认api接受字符串形式的html标记。如果你想设计正文,你必须写内联css或者同时发送消息正文中的
部分。你能提供一个例子吗?