How do i read and extract information from Outllook .MSG file
843834Dec 17 2009 — edited Dec 18 2009Hi,
I have a .msg file saved on my local drive. I want to read the file and extract information such as "sender", "to", "CC", "BCC", date sent / received and subject.
I'm using POI-HSMF which seems to be perfect for the task, but it's not returning exactly what i want. Below is the code i'm using to test:
MAPIMessage msg = new MAPIMessage("c:\\Emailing_22-11-2009.msg");
System.out.println("From :" + msg.getDisplayFrom());
System.out.println("TO :" + msg.getDisplayTo());
System.out.println("CC :" + msg.getDisplayCC());
System.out.println("BCC :" + msg.getDisplayBCC());
System.out.println("Subject :" + msg.getSubject());
The results returned are the names assigned to email addresses, not the actual email address. For example : 'Peter Bloom' instead of pbloom@forums.com
How do i get the actual email address or is there another library in which i can use to achieve the same results?
The msgparser library is kind of limited because i cannot read addresses on CC, and BCC.
Please help,
Thank,
LM