I'm creating a automatic email response, but I don't want to show the original email in the response. There is a line in the email that they must respond above. But email programs add a line like "On Aug 21, 2012, at 11:30 PM, David wrote:" before this line.
I'm using this code to split the response into two parts. It's just not working correctly.
$parts = preg_split('/([\r|\n].+[\r|\n]>[\r|\n])?(> )?--- ABOVE THIS LINE ---/',$in->body);
The email body that it's splitting is
test from user back again
On Wed, Aug 22, 2012 at 9:55 AM, Support <support@example.com> wrote:
> --- ABOVE THIS LINE ---
>
> Support Ticket
What I want to do is split at the line with content above the --- ABOVE THIS LINE --- bit. In other words I want to remove the "On Wed, Aug 22..." line. I assume not all email programs put this line and if they do, they do it differently. In this example, the email program is actually adding a blank line as well.