0
我使用EWS 1.2來搜索我的郵箱中有附件的電子郵件,我將EmailMessage對象綁定到EWS對象。這是工作的罰款,但沒有檢測到.msg文件(Outlook郵件文件):電子郵件消息時,EWS無法檢測到.MSG文件
ItemView mailview = new ItemView (12);
FindItemsResults<Item> resultmail;
resultmail = Service.FindItems(WellKnownFolderName.Inbox, mailview);
foreach (Item item in resultmail.Items)
{
EmailMessage email = EmailMessage.Bind(Service, item.Id,
new PropertySet(BasePropertySet.FirstClassProperties,
ItemSchema.Attachments));
if (email.HasAttachments)
{
foreach (var attachment in email.Attachments)
{
if (attachment is FileAttachment)
{
Console.WriteLine("email has : " + email.Attachments.Count
+ "attachement(s)" + "\n");
Console.WriteLine("attachment name:" + attachment.Name);
}
}
}
}
謝謝你的工作 – ssq