title: Get the actual email message that the person just wrote, excluding any quoted text
body: <p>There are two pre-existing questions on the site. 
  One for Python, one for Java.</p>
  
  <ul>
  <li>Java <a href="https://stackoverflow.com/questions/2385347/how-to-remove-the-quoted-text-from-an-email-and-only-show-the-new-text">How to remove the quoted text from an email and only show the new text</a></li>
  <li>Python <a href="https://stackoverflow.com/questions/5420402/reliable-way-to-only-get-the-email-text-excluding-previous-emails">Reliable way to only get the email text, excluding previous emails</a></li>
  </ul>
  
  <p>I want to be able to do pretty much exactly the same (in PHP). I've created a mail proxy, where two people can have a correspondance together by emailing a unique email address. 
  The problem I am finding however, is that when a person receives the email and hits reply,  I  am struggling to accurately capture the text that he has written and discard the quoted text from previous correspondance. </p>
  
  <p>I'm trying to find a solution that will work for both HTML emails and Plaintext email, because I am sending both. </p>
  
  <p>I also have the ability if it helps to insert some <code>&lt;*****RESPOND ABOVE HERE*******&gt;</code> tag if neccessary in the emails meaning that I can discard everything below. </p>
  
  <p>What would you recommend I do? Always add that tag to the HTML copy and the plaintext copy then grab everything above it? </p>
  
  <p>I would still then be left with the scenario of knowing how each mail client creates the response. Because for example Gmail would do this:</p>
  
  <pre><code>On Wed, Nov 2, 2011 at 10:34 AM, Message Platform &lt;35227817-7cfa-46af-a190-390fa8d64a23@dev.example.com&gt; wrote:
  ## In replies all text above this line is added to your message conversation ##
  </code></pre>
  
  <p>Any suggestions or recommendations of best practices?</p>
  
  <p>Or should I just grab the 50 most popular mail clients, and start creating custom Regex for each. Then for each of these clients, also a bizallion different locale settings since I'm guessing the locale of the user will also influence what is added. </p>
  
  <p>Or should I just remove the preceding line always if it contains a date?.. etc</p>