Hi there
We are working on saving .msg file into HTML format.
And here is our code for test:
byte[] msgContent;
msgContent = IOUtils.toByteArray(new FileInputStream("mailTest.msg"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
MailMessage msg = MailMessage.load(new ByteArrayInputStream(msgContent));
HtmlSaveOptions saveOps = new HtmlSaveOptions();
saveOps.setCheckBodyContentEncoding(true);
saveOps.setEmbedResources(true);
saveOps.setMailMessageSaveType(MailMessageSaveType.getHtmlFormat());
msg.save(baos, saveOps);
IoUtil.write(new FileOutputStream("result.html"), baos.toByteArray());
Please also check the input file and output file in the attachment.
Some characters in the result are not rendered correctly.
Is there some option to fix this?
Craig