I am writing an app to let users reply to a post or thread straight from their email similar to Facebook. Users can already add new posts via email and it is working fine.
When a new post is generated an email alert is sent to specific users and a unique reply address is created containing an encoded string with the original post/thread ID. This is working fine. The emails are sent and the system picks up the reply using the unique reply address.
My problem is trying to isolate the comment/reply in the email, from the quoted original email underneath. Here is an example of an email body received:
reply text
(Origional Email Header)On 10 March 2011 16:35, Example SIte
<[email protected]= > wrote:
I have thought of using identifying characters or strings but each email provider displays the original email in a reply differently.
Does anyone have any ideas how I can isolate the reply text from the original email's header and body?
Thank you,
Chris.
For a support ticket system I wrote, I focused on using the References email header concatenating previous message ids onto that. Many systems will hold onto that, but, of course, not all. Plus, my system is organic, ie, attempts to process emails with any subject and body in less of a controlled environment. A work in progress.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With