【问题标题】:EWS - Get attachments without body attachmentsEWS - 获取没有正文附件的附件
【发布时间】: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


    【解决方案1】:

    解决方案:检查附件是否有属性“IsInline”为假。

    【讨论】:

      猜你喜欢
      • 2018-01-04
      • 2015-04-11
      • 2016-12-16
      • 1970-01-01
      • 1970-01-01
      • 2022-12-28
      • 1970-01-01
      • 1970-01-01
      • 2011-04-23
      相关资源
      最近更新 更多