Unable to view Metadata of MSG files

Hi ,

I am using Aspose.Email.dll(1.2.0.0).net 3.5. In that we have an option to save mailmessage to stream object by selecting either

MailMessageSaveOptions.WriteHeaderToMht or MailMessageSaveOptions.WriteOutlineAttachmentsToMht or MailMessageSaveOptions.None

But I want both the options WriteHeaderToMht and WriteOutlineAttachmentsToMht .

Kindly let me know if we have any option to get both the options.

Thanks,

Ponraj.M

Hi Ponraj,


Thank you for your inquiry.

By using the both options you mean to save your message file to MHT Stream with all headers and attachments. If this is right then you can do this by not specifying the MailMessageSaveOptions and simply saving the message to stream in MTH format.

Please check the sample code,
C#
var message = MailMessage.Load(“sample.msg”);
vat stream = new MemoryStream();
message.Save(stream, MailMessageSaveType.MHtmlFromat);//,MailMessageSaveOptions.WriteHeaderToMht);

If I am wrong in my understanding then please correct me.

Regards,

Thanks working fine.