I am trying to save a java mail message (javax.mail.Message
) as an outlook message (.msg extension
).
However, Message.write(FileOutputStream)
does not allow me to open the outlook file. It receives an error about permissions or the file was not found.
I have tried to use apache-poi (3.7)
, however, running into problems there also:
MAPIMessage outlookMsg = new MAPIMessage(msg.getInputStream())
outlookMsg.write(out)
where msg
is a javax.mail.message
and out is a fileoutput
stream.
I get the following error : Invalid header signature; read 0x415F3030305F2D2D, expected 0xE11AB1A1E011CFD0
What is the solution to solve this? Should I save with java mail another way?
Thank you in advance.