我正在使用 EmailMessage 发送带有附件的邮件。该附件是 .html 文件。我成功地在电子邮件中附加了文件。但是那个 html 不能正确显示。Html 文件在附件内容中显示了一些标签。
代码返回如下,
attach_file_name 是我要显示的文件路径,即“/path/of/html/file.html”
msg = EmailMessage(subject, content, from_email, to_list, cc=cc_list, bcc=bcc_list)
if attach_file_name:
msg.attach_file(attach_file_name)
msg.content_subtype = "html"
msg.send()
请帮我