If I would need to solve this question, I would be using some kind of 'diff' system. I don't' know if that exists for PHP, but I'm confident it does.
So then more technical, if you have a way to diff the mails. I would take the original mail without the header (let's call it mail A), and also the new mail without the header (mail B). Then it's as easy as comparing mail A with B and see what the difference is. The lines that were added, are the response of the user.
Some things you will have to look for yourself, because I don't know an answer for them at this moment:
- What if the user doesn't send the original message? You could for example only use the lines that were added from your diff, not those which were deleted.
- What if the user changes something inline in your response? I have no idea how to solve this.
My solution would actually be to don't give the users that much freedom. Just prepare a place where the users should write their message. Something like: "Write your message between the following lines <line> <line>", or "<line>Write your message above the previous line". Then you know where to look for the text.
The more freedom you give, the more difficult it becomes for you. You can start with an easy system, and gradually improve the intelligence of the system. That's how I start most of the time: start from something simple and increase the difficulty gradually.