Save Email Message using Aspose.Email and Apache POI HSMF

Aspose.Email - Save Email Message method is available to save EMail messages in various formats.


 MailMessage messageMSG 	= MailMessage.load(dataDir + "message.msg"); + "AsposeMessage.msg"); + "AsposeMessage.eml"); + "AsposeMessage.emlx"); + "AsposeMessage.mht");

Apache POI HSMF - Save Email Message

EMail body can be extracted to create new file.


 String filename = "message.msg";

MAPIMessage msg = new MAPIMessage(filename);

PrintWriter txtOut = new PrintWriter("ApacheMessage.txt");

txtOut.println("Email Body: " + msg.getTextBody());


Download Running Code

Download Sample Code