javascript - 原始 HTML 正在通过我的网络应用程序发送
问题描述
我正在尝试nodemailer
为我的网站实施电子邮件验证系统,但它正在向html
用户发送原始邮件。请帮忙
var html = '<h1>Hello !</h1><p>This is some content \
that will display. You can even inject your first name, \
in the code.</p><p><a href="http://www.google.com">Search</a> for \
stuff on the Google website.</p>';
let mailOptions = {
from: "abc@gmail.com", // TODO: email sender
to: "example@gmail.com", // TODO: email receiver
subject: "Account Verfication",
text: html,
};
// Step 3
transporter.sendMail(mailOptions, (err, data) => {
if (err) return log(err);
});
解决方案
您将其作为文本发送。请改用“html”键。请参阅https://nodemailer.com/message/
推荐阅读
- java - 如何使用应用程序小部件从 AlarmManager 设置警报?
- google-cloud-dataproc - Dataproc:HDFS 上的热数据,云存储上的冷数据?
- html - 如何将图标集中在小边框元素内?
- javascript - 承诺 IF 条件始终为假 JavaScript
- android - 使用 Flutter 和 Firebase 时如何更改应用程序 ID?
- python - TypeError: '>' 在 'str' 和 'int' 的实例之间不支持,但我将字符串设为整数
- swift - CryptoKit 加密文件太大而无法存储
- acumatica - 在 SOSshipmentPlan 上覆盖用于 PXProjection 的 BQL
- python - 在 GSI 上使用值列表进行 DynamoDB 查询 - Python
- networking - JADE 使用什么连接协议来通过网络进行代理到代理的连接?