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

Free Support Forum - aspose.com

Retreiving properties for MSG file


I want to read all the properties from a MSG file. How do I go about it?

Hi Cornelius,

Thank you for writing to Aspose Support team.

You need to go through the normal as well as named properties of a message file for this purpose. Please have a look at the following sample code and let us know if you have any further query in this regard.

Sample Code:

// Load a working Task request
MapiMessage msg = MapiMessage.FromFile(“MSOutlook-TR.msg”);

// Copy properties
foreach (DictionaryEntry entry in msg.Properties)
Console.WriteLine(entry.Key + “-” + entry.Value);

// read mapping
MapiNamedPropertyMappingStorage storage = msg.NamedPropertyMapping;
foreach (DictionaryEntry entry in storage.Properties)
Console.WriteLine(entry.Key + “-” + entry.Value);