Hi Liza,
Thank you for your inquiry.
We have looked into the API, it is not confirmed but it seems that FormatTemplates depend upon language setting of the local PC. It will not always be in English. You can use FormatTemplates property of MhtSaveOptions class to translate the formats. Sample code snippet is given below for your reference.
Sample Code:
string emlPath = “test_sample.eml”;
MailMessage mail = MailMessage.Load(emlPath, new EmlLoadOptions());
MhtSaveOptions options = Aspose.Email.Mail.SaveOptions.DefaultMhtml;
options.MhtFormatOptions = MhtFormatOptions.WriteHeader;
options.FormatTemplates[“From”] = options.FormatTemplates[“From”].Replace(“From:”, “SOME_OTHER_WORD:”);
options.FormatTemplates[“Sent”] = options.FormatTemplates[“Sent”].Replace(“Sent:”, “SOME_OTHER_WORD:”);
options.FormatTemplates[“To”] = options.FormatTemplates[“From”].Replace(“To:”, “SOME_OTHER_WORD:”);
options.FormatTemplates[“Subject”] = options.FormatTemplates[“Sent”].Replace(“Subject:”, “SOME_OTHER_WORD:”);
mail.Save(“test_sample_out.mhtml”, options);
Furthermore it is suggested to use MthTemplateName instead of using phrases. For details please visit the API reference guide link MthTemplateName Class.
Please try it at your end and let us know your feedback. Keys that can be used for FormatTemplates are also given below:
- PageHeader
- Location
- Start
- End
- ShowTimeAs
- Recurrence
- RecurrencePattern
- Organizer
- RequiredAttendees
- DateTime
- From
- Sent
- To
- Cc
- Bcc
- Subject
- Attachments