Mimemessage在C#中的电子邮件中显示空体?

发布于 2025-02-02 19:39:52 字数 323 浏览 3 评论 0原文

我想在邮件中显示HTML主体,我正在使用Windows服务通过SMTP服务器发送邮件。我将请求写在文件中&将此文件传递到mime.load()方法以读取该文件并从该文件中提取数据,但是在这里我以纯文本格式获得了主体,&因此,空体显示了何时发送电子邮件。我为此为此编码,我将C#用于编码,

var message = MimeMessage.Load(emailFile);

我具有HTML主体,但是当我检查此消息时,它仅提供了纯文本,并且没有显示其HTML版本。我在这里不明白如何将纯文本主体设置或更改为Mime的HTML身体。有人知道解决方案吗?谢谢

I want to show html body in mail, I was sending mail through SMTP server using windows service. I write the request in a file & pass this file to MIME.Load() method to read that file and extract the data from that file, but here I get body in plain text format, & so empty body shows when actual email sent. I code for this as below, I use C# for coding

var message = MimeMessage.Load(emailFile);

I have html body but when I checked this message it gives me only plain text and does not shows its html version. I don't understand here how to set or change plain text body to html body in Mime. Does anyone knows about the solution. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文