PHP IMAP get body text without reply

240 views Asked by At

I only want to get body text, without any reply text/html. When I use imap_fetchbody it gives all the text including primary email and replies text/html. Is there any way that I can get only mail text? Also, I have no exact text pattern for splitting or parsing the content from the end (red horizontal line). How can I achieve this?

enter image description here

I have tried imap_fetchbody, imap_fetchstructure to get only the primary email text, it gives all the text including reply email text. I can split text from FROM: but as you can see Random Name and other stuff will still appear which I need to remove.

0

There are 0 answers