Search code examples
javaemailoutlookaspose

How to get pdf rendition exactly same as displayed in outlook


I am trying to convert a '.eml' to 'mhtml' using Aspose.Email for Java.

Issue:

In Microsoft outlook view some .emi files may show both Name and Email address in the To and From section and some might have only Name in the 'To' section.

My try

The OUTPUT, i am getting is based on the option i supply explicitly i.e. either MhtFormatOptions.WriteCompleteEmailAddress or MhtFormatOptions.WriteCompleteFromEmailAddress

My query How to make it pick automatically based on the outlook view without explicitly providing arguments for particular file as the target rendition has to be exactly similar to what is displayed in the outlook.

enter image description here

For example in the above screenshot only names in the From and To section are displayed in the Microsoft Outlook.


Solution

  • Aspose Email 17.5 onwards, they have introduced MhtFormatOptions.DisplayAsOutlook in their api, which in turns displays header as in Outlook