How to process email in php?

Hello,

As everyone knows that cpanel lets you create piped emails which sends an incoming email to the defined php script. I have done the same and it seems to be working.

Now I am in the problem that every email that comes in is different I mean the email headers etc. are different. Is there any php class which would parse that email and give me the info in an array like or maybe something similar ?

From Name , From E-Mail , Subject, Message Body.

Please help.

Thanks.

I did stumble on a class like this once but it wasn’t brilliant. It’s Franks email parser. It works… ish but its far from perfect. Again like you I’ve had problems with headers which vary and parsing them myself wasn’t very successful because of some headers extending on to the line below etc.

It gets worse when you swap to different hosts and operating systems…