问题描述
我写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和<$ C的最佳方式$ C>附件 S'
What is the best way to map different MIME parts to AlternateView
s, LinkedResource
s, and Attachment
s?
修改:这将适用于所有的邮件客户端(发送和接收)
EDIT: That will work with all mail clients (both sending and receiving)
推荐答案
现在,我复制了内容处置
这不是<$ C什么$ C>在线,或以外的任何文本或图像,一个附件
之外的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)
这篇关于MIME树转换为MailMessage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!