Hi there
Hi Craig,
Thank you for contacting Aspose support team.
Please try to specify the text encoding using MsgLoadOptions.setPrefferedTextEncoding for all the characters to be recognized. Please see sample code below,
byte[] msgContent;
msgContent = IOUtils.toByteArray(new
FileInputStream("mailTest.msg"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
MsgLoadOptions msgLoadOpt
= new MsgLoadOptions();
msgLoadOpt.setPrefferedTextEncoding(Charset.forName("UTF-8"));
MailMessage msg = MailMessage.load(new ByteArrayInputStream(msgContent),
msgLoadOpt);
HtmlSaveOptions saveOps = new HtmlSaveOptions();
saveOps.setCheckBodyContentEncoding(true);
saveOps.setEmbedResources(true);
saveOps.setMailMessageSaveType(MailMessageSaveType.getHtmlFormat());
msg.save("result.html", saveOps);
Please try the above code at your end and let us know your feedback.
Hi Maria.Shahid
You are welcome. Please feel free to write back to us in case of any further query.