title: Extract email message itself from all its prior messages and meta data (Sendgrid Parse API/PHP)?
body: <p>I'm using <a href="http://sendgrid.com/docs/API_Reference/Webhooks/parse.html" rel="noreferrer">Sendgrid and their Parse API</a> to send/receive email. The Parse API allows one's web app to receive email as a $_POST but the problem is that in the $_POST I want to be able to extract the message itself from its prior messages and meta data that get chained along.</p>
  
  <p>To show you what I mean in the following picture, i'd just like to capture the text, <strong>"trying sending from 12373 to 12373 from GMAIL"</strong> and not all the junk below it. If that is not possible, does anyone have any suggestions on how to parse the email body (<code>$_POST['text']</code>) such that I can separate out the message itself? </p>
  
  <p>The problem is see is that depending on the email client (gmail, outlook, etc.), It's not clear to me that the date information, in this case: "On Wed, Jan 23, 2013...", will allows follow the message itself. If all email client's put the date beneath the message, then it would seem I could design a fancy regex to look for a line break followed by a date or something. Thoughts?</p>
  
  <p><img src="https://i.stack.imgur.com/ZXfzP.png" alt="**Entire** Message body containing prior messages"></p>