This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Retrieving the last reply from a mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Retrieving the last reply from a mail" Watch "Retrieving the last reply from a mail" New topic
Author

Retrieving the last reply from a mail

Mike Anna
Ranch Hand

Joined: Jul 08, 2007
Posts: 117
Hello,

Currently I am using to fetch all the messages from a POP3 account that I have to poll. However, I am not aware of how/if I could fetch only a reply from a particular mail.
For ex., a mail is sent to a user and he replies to the mail. So the replied mail contains the originally sent mail too. I need only the users reply.
I was also thinking of demarcating it based on some special characters, but that wouldnt work if the user deleted the original mail.

Could you please guide me on .. if there is some way I can do it ?


Thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

Try using folder.search(...) instead of folder.getMessages(). With a FromTerm or a FromStringTerm you can filter out all emails not sent by that user. I don't know how to proceed after that, but perhaps you can investigate the emails to see if they have any information. Especially the headers may be useful.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieving the last reply from a mail