EWS代码和电子邮件签名

本文关键字:电子邮件 代码 EWS | 更新日期: 2023-09-27 18:00:23

目前我正在使用Microsoft.Exchange.WebServices.Data库读取电子邮件地址并发送到数据库。然而,我遇到了麻烦,因为我现在想循环浏览一封电子邮件的附件,但不包括电子邮件签名中包含的任何附件(图像)。

我可以通过获得非嵌入图像

if (emailMessage.HasAttachments)
{
    foreach (FileAttachment fileAttachments in emailMessage.Attachments)
    {
        FileAttachment fileAttachment = emailMessage.Attachments[i.Attachments.IndexOf(fileAttachments)] as FileAttachment;
        fileAttachment.Load();
        if (!fileAttachment.IsInline)
        {
        }
    }
}

但是有没有一种方法可以获得签名中没有的嵌入图像?

EWS代码和电子邮件签名

您必须执行与本例相反的操作http://www.independentsoft.de/exchangewebservices/tutorial/createinlineattachment.html

检查FileAttachment上的ContentId属性值,并检查消息正文中是否存在相同的值。这些图片不是电子邮件签名的一部分。