We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Identify Attachment Type in MapiMessage

Greetings,

How can we identify whether the attachment is:

  • Linked attachment
  • Embedded attachment
  • Inline attachment
in a MapiMessage using Aspose.Email?

Looking forward for an early reply.

Regards,
Syed.

Asa Syed,

Thank you for inquiry.

You may use the following code to detect these attachment types.

foreach (MapiAttachment att in msg.Attachments)
{
if
(att.Properties.Contains(MapiPropertyTag.PR_ATTACH_CONTENT_ID_A) ||
att.Properties.Contains(MapiPropertyTag.PR_ATTACH_CONTENT_ID_W))
{
Console.WriteLine("Embedded, inline or linked Attachment File Name: " + att.LongFileName);
}
else
{
Console.WriteLine("Regular Attachment File Name: " + att.LongFileName);
}
}

Walaikum Aslaam Saqib,

Thank you for code. I will get back to you in case this doesn’t help me out.

Regards,
Syed.