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

Free Support Forum - aspose.com

How to customize headers when saving email to PDF

We are using an old version of Aspose.Email: 16.11 and are interested to upgrade to the latest version.
The upgrade is seamless for us except for some code that saves an email as PDF.

Our code uses the obsolete MhtMessageFormatter class. This class allows us to modify and style how the email headers (from, to, date, subject, etc…) are saved as Mhtml and later as PDF.

Is there another way in the latest version to customize the email headers
or what documented at: https://docs.aspose.com/display/emailnet/Saving+an+Email+as+PDF
is the only way?

Thanks for your help!


You can avail the same feature in the latest version of the API with modifications as listed in conversion to MHTML section. Please try it at your end and let us know your feedback.

It appears that the old version of Aspose Mail (16.11) provided more flexibility.

Using an example, we were able to write the header date for an email in the following format:
Wednesday, January 25, 2017 2:30 PM CST

In the latest version by default the same email header date displays by default as:
Wed, 25 Jan 2017 14:30:10 -0600

with customized time zone offset the date displays as:
Wed, 25 Jan 2017 20:30:10 +0000

Could you confirm if there is a way to for example customize the date format in the header?


The date format cannot be customized. Please find date format details as specified in RFC documentation on the link given below:

Moreover, we have logged this issue with ID “EMAILNET-39115” for further investigation in order to make it more flexible. You will automatically be notified here once we have more information.