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

Free Support Forum - aspose.com

Difference MailMessage and MapiMessage

Hi,

I am evaluating your Email product since we are looking for a solution for working with MSG-files in our Java application.

I noticed that there are two classes available for working with MSG-files, these being MailMessage and MapiMessage. Which one should be used? On first sight I cannot really make a distinction between the two since they both seem to support reading in MSG-files and creating MSG-files. According to the documentation MapiMessage only works with MSG-files where as MailMessage also works with EML-files for example. Is MailMessage maybe more limited compared to MapiMessage when working with MSG-files?

Thanks in advance!

Kind regards,
Yannick

Hi Yannick,


Thank you for writing to Aspose suppor team.

You have got the right difference between the two i.e. MailMessage has additional capability to process EML and MHT files as well, while the MapiMessage class can deal with MSG files only. However, MapiMessage can be used to load an EML file that is already loaded in MailMessage using the MapiMessage.FromMailMessage method. Following are some of the features that are supported by MapiMessage only:

1. MailMessage doesn’t give you access to the Message property stores which is only available in MapiMessage. You can have a look at our article Accessing Outlook Mapi Properties for this purpose.

2. MapiMessage can be used to load MSG files directly and add them to PST. MailMessage objects can not be added directly to a PST as these need to be converted to MapiMessage first.

3. Other outlook items such as Contacts, Tasks, Distribution lists and Notes are also dealt by MapiMessage only.

Please feel free to write to us in case you have any additional query/inquiry in this respect.

Hi Kashif,

Thanks for your reply!

This certainly clarifies a lot. I noticed #1 as well since when I converted a MailMessage to MapiMessage and saved it to a file the file had its size reduced.

Hi Yannick,


Reduction in size doesn’t related to any loss of data or other such activity as some fields are compressed during the conversion. Neither this has any impact on the data display in Outlook as well. Please let us know if you have any further query/inquiry related to Aspose.Email. We’ll be glad to assist you further.