Extract Message Body using Aspose.Email and Apache POI HSMF

Aspose.Email - Extract Message Body

The MailMessage represents an email message and allows developers to access email message properties. The header information (discussed in Extracting Email Headers) can be extracted and manipulated in different ways.

Java


 MailMessage msg = MailMessage.load(dataDir + "message.msg");

System.out.println("Body:"+ msg.getBody());

System.out.println("Text Body:"+ msg.getTextBody());

System.out.println("Text Body HTML:"+ msg.getHtmlBody());

Apache POI HSMF - Extract Message Body

MAPIMessage can access email message body.

Java


 MAPIMessage msg = new MAPIMessage(dataDir + "message.msg");

System.out.println("Text Body:"+ msg.getTextBody());

Download Running Code

Download Sample Code