Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reply to thread via email

Tags:

php

email

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.

like image 932
Kit Avatar asked Mar 10 '11 17:03

Kit


1 Answers

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.

like image 186
Tom Avatar answered Sep 27 '22 22:09

Tom