删除后,附件仍在导出的EmailMessage中

时间:2016-02-03 15:42:23

标签: c# attachment exchangewebservices

为什么在删除附件后,附件仍然在导出的.eml文件中?

GetItemResponse i;
EmailMessage item = (EmailMessage)i.Item;

item.Attachments.Clear();
item.Update(ConflictResolutionMode.AlwaysOverwrite);

string filename = $"{item.Subject}.eml";

using (var fileStream = new FileStream($@"C:\{filename}", FileMode.Create))
{
    fileStream.Write(item.MimeContent.Content, 0, item.MimeContent.Content.Length);
}

0 个答案:

没有答案