【发布时间】:2023-03-06 08:31:02
【问题描述】:
我用 EWS 编写了一个控制台应用程序来读取邮箱,从邮件中获取所有附件(如果有的话),然后删除邮件。
现在我有一个“问题”,即在我的附件列表中还有一些项目,例如正文中的页脚图像。有没有办法检查它是否是身体图像?
这是我的代码:
if (mail.HasAttachments) {
EmailMessage message = EmailMessage.Bind(service, mail.Id, new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.TextBody, EmailMessageSchema.Attachments));
foreach (Attachment Att in message.Attachments) {
if (Att is FileAttachment) {
FileAttachment fileAtt = Att as FileAttachment;
//DO STUFF
}
}
}
谢谢
【问题讨论】:
标签: c# email exchangewebservices