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

Free Support Forum - aspose.com

How to get the email categories when saving as mhtml format

the attached email has got a category named “moovapps Document”.
when i save the attached email as mhtml format from Outlook, the categories list appears.
when i save it thru Aspose, it doesn’t appear.
Is it possible to get the list of categories when saving to mhtml with aspose ?
thanks in advance.temp.zip (23.5 KB)


I have observed the MSG and MHTML file share by you. There is difference between source MSG and exported MHTML. Can you please share the source code and also share the machine specifications and culture on your end.

source code attached.
My question is “how to get the categories when saving to mhtml with aspose as Outlook does”.
Thanks in advance.Program.zip (1.6 KB)


I have observed your requirements and regret to share that at present the requested support is not available in API. A ticket with ID EMAILNET-39852 has been created in our issue tracking system as new feature request to provide requested support. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

meanwhile, i add the following code.
Is it correct ?

                    // on ajoute les catégories
                    if ((mapiMessage.Categories != null) && (mapiMessage.Categories.Length > 0))
                        string categories = mapiMessage.Categories[0];
                        for (int i = 1; i < mapiMessage.Categories.Length; i++)
                            categories = categories + "," + mapiMessage.Categories[i];
                        mhtOptions.FormatTemplates[MhtTemplateName.Subject] = mhtOptions.FormatTemplates[MhtTemplateName.Subject] + "<br/><span class='headerLineTitle'>Catégories:</span><span class='headerLineText'>" + categories + "</span>";


I have observed the information shared by you. Yes, this is a workable option where you have extracted category information separately from MapiMessage and have added that in a custom manner in MhtTemplateName.Subject information. However, the issue that we have added is for providing an option for categories in MhtTemplateName to properly use the API.

The issues you have found earlier (filed as EMAILNET-39852) have been fixed in this update.