Hi, I like your attachment example :
foreach (MapiAttachment attachment in msg.Attachments)
attachment.Save(attachment.DisplayName);
However, if my attachments are outlook messages, they do not open correctly.
In MAPI, there are attachment properties, PR_ATTACH_METHOD to determine what kind of attachment is in the message.
I see your example of saving an embedded attachment:
foreach (MapiAttachment attachment in msg.Attachments)
{
MapiMessage attMsg = MapiMessage.FromProperties(
attachment.ObjectData.Properties);
MailMessageInterpretor mi = MailMessageInterpretorFactory.Instance.GetIntepretor(
attMsg.MessageClass);
string attachmentName = string.Format("{0}.eml",attachment.DisplayName);
FileStream fs = new FileStream(
attachmentName,
FileMode.Create);
mi.Save(attMsg, fs, Aspose.Network.Mail.MessageFormat.Eml);
}
But, how can I extract an attachment property to determine which kind of attachment it is: PR_ATTACH_DATA_OBJ or PR_ATTACH_DATA_BIN in order to know which way to save my attachment?
Also, I cannot save using the MessageFormat.Msg. I get an exception thrown that it is not supported. Can you tell me if you know when that will be supported?
Thanks,
Karen Schmidt