Show or Hide Extra Print Headers

Aspose.Email - Show or Hide Extra Print Headers

Extra print headers can be shown or hidden with MhtFormatOptions and MailMessageSaveOptions. MhtFormatOptions is an enumerator which contains two members - WriteCompleteEmailAddressToMht and HideExtraPrintHeader. MhtFormatOptions is used withMhtMessageFormatter as the public method MhtMessageFormatter.Format with argument writeCompleteEmailAddress is obsolete now.

Java


 MailMessage message = MailMessage.load(dataDir + "message.eml");

String encodedPageHeader = "<div><div class=3D'page=Header'>&quot;Panditharatne, Mithra&quot; &lt;mithra=2Epanditharatne@cibc==2Ecom&gt;<hr/></div>";

int saveOptions =  MailMessageSaveOptions.HideExtraPrintHeader;

message.save(dataDir + "AsposeHideExtraHeaders.mhtml", MailMessageSaveType.getMHtmlFormat(), saveOptions);

Download Running Code

Download Sample Code