Reputation: 59
I am using the imap_xxxx functions to read the emails body. My problem is to find out only the current portion of the email body not the complete email. When user reply for an email it not only contains the his response but the complete mail chain.
Thanks,
Upvotes: 0
Views: 59
Reputation: 449425
There is no standard for this - E-Mails are simply walls of text, quoted text, portions of quoted text from previous messages. There is no "current portion" of an E-Mail because there is no delimiter to tell apart which is which.
There are some patterns though: very often, the previous E-Mail part will start with "xyz wrote on ....". Other E-Mail clients will precede previous conversations with >
characters or indent the blocks. Still, there's nothing definite here.
You'd have to start parsing the portions yourself (or find a class that does it). It's possible - Facebook does it when parsing E-Mails that reply to Facebook messages. The question is how much effort you'll have to put in it.
Upvotes: 2