PHP Raw Email Parser
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2108a32 Sep 5, 2013



N.B.: if you deal with non-English languages, we recommend you install the IMAP PHP extension:
the Plancake PHP Email Parser will detect it and used it automatically for better results.

This library allows you to easily parse an email given its content (headers + body).

Usage example:

$emailPath = "/var/mail/spool/dan/new/12323344323234234234";
$emailParser = new PlancakeEmailParser(file_get_contents($emailPath));

// You can use some predefined methods to retrieve headers...
$emailTo = $emailParser->getTo();
$emailSubject = $emailParser->getSubject();
$emailCc = $emailParser->getCc();
// ... or you can use the 'general purpose' method getHeader()
$emailDeliveredToHeader = $emailParser->getHeader('Delivered-To');

$emailBody = $emailParser->getPlainBody();

For more info:


We love to hear from you ♥. Please, send us any feedback.
Even if you don't speak English, don't worry, use your native language (we have great confidence in Google Translate :-))

Please contact us if you need any commercial support with the installation of any component or if you would like any customization:

Please consider contributing with bug fixes or improvements:

Plancake homepage:
Subscribe to our blog:
Follow us on Twitter:
Follow us on Facebook:
Donations ♥ :

"Plancake" and "Plancake Team" are trademarks of Daniele Occhipinti.
(by the way, what about using Plancake Team for team collaboration?

Brought to you by Danyuki Software Limited, a startup tech company based in London, UK.

Happy plancaking!

Daniele Occhipinti
Director and Founder of Plancake
skype: dan_plan (I can speak English and Italian)