Have you seen this? http://stackoverflow.com/a/12611562/1972101
Oct 13, 2016
3
Level 5
Filter latest reply from php imap
Hi,
I'm using the PHP imap lib. I have no problems pulling e-mails and reading the plain body. ($mail->textPlain). However this takes the entire body (including the conversation/history). I want to filter the history and only keep the reply. I tried using regex and that works fine for Gmail but for other email clients it doens't work. Does someone knows a workaround or a library?
preg_replace('#(^\w.+:\n)?(^>.*(\n|$))+#mi', "", $mail->textPlain);
I'm aware that php imap does not provide a method for that but I'm want to know if there are libraries for it.
Please or to participate in this conversation.