MIME树转换为MailMessage转换为、MIME、MailMessage

2023-09-03 04:11:16 作者:喝旺仔旳小女生

我写AA C#程序处理和转发电子邮件。我有一个POP3图书馆和MIME解析器,我需要的MIME树复制到 System.Net.Mail.MailMessage

I'm writing a a C# program that processes and forwards email messages. I have a POP3 library and a MIME parser, and I need to copy the MIME tree into a System.Net.Mail.MailMessage.

什么是映射不同的MIME部分 AlternateView S, LinkedResource s和附件 S'

What is the best way to map different MIME parts to AlternateViews, LinkedResources, and Attachments?

修改:这将适用于所有的邮件客户端(发送和接收)

EDIT: That will work with all mail clients (both sending and receiving)

推荐答案

现在,我复制了内容处置这不是在线,或以外的任何文本或图像,一个附件之外的MIME类别,任何内联图片 LinkedResource 在HTML视图中的MIME类东西或最后一个观点,和其他任何为 AlternateView 。 (我没有测试过)

Right now, I'm copying anything with a Content-Disposition which isn't inline, or with a MIME category of anything other than Text or Image, to an Attachment, anything inline, or anything with a MIME category of Image to a LinkedResource on the HTML view or the last view, and anything else as an AlternateView. (I haven't tested this yet)