PHP: imap_body & # 8594; get only message text

I use php imap functions to retrieve email content from my mail server.

So far, this has worked fine with the headers, but I would like to get a β€œclean” text that contains the message.

At the moment, it looks like this:

Body:

--Apple-Mail=_0DCDC337-EC65-4217-B5CB-B3A2675D8573
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
    charset=utf-8

This is the text i want

--Apple-Mail=_0DCDC337-EC65-4217-B5CB-B3A2675D8573
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
    charset=utf-8

Quoted text

--Apple-Mail=_0DCDC337-EC65-4217-B5CB-B3A2675D8573--

This is the result if I use:

$body       =       imap_body($connection, $moverview->msgno,2);        

It would be best if I received only the last text ("This is the text I want") - not even quotes.

Any idea how I could solve this?

Thanks in advance: -)

+4
source share

All Articles