I am trying to separate contents within an incoming email.
Whenever the user receives and email with a marker line (### Reply above this line to append to the ticket ###) and if he clicks reply to this email the reply area starts with
On Apr 22, 2010, at 11:22 AM, Test wrote:
Reply above this line to append to the ticket ###
Now when PHP script find the string (### Reply above this line to append to the ticket ###) and cut the mail into two parts and uses the first one which has in this example On Apr 22, 2010, at 11:22 AM, Test wrote: along with unclosed < blockquote > and < div > tags.
How can i remove the content in such a manner 开发者_JAVA百科where i can use the content above the "On Apr 22, 2010, at 11:22 AM, Test wrote:" line.
Any help, anyone who has tried this earlier.
thank you.
Your question is not very clear.
Do you mean that the initial 3 hashes are stripped when the user clicks on reply? This implies that the users MUA is broken - when I click on 'Reply' I expect it to quote the original message unmolested. Regardless the solution is just to split the message on 'Reply above this line to append to the ticket ###' instead of '### Reply above this line to append to the ticket ###'
Or is this just an issue with SO's formatting of your message?
Do you mean that when you cut off the first part, the HTML is badly formed? If so, just use a regex to strip out any HTML tags (the built in PHP strip_tags function might work too).
C.
精彩评论