Yet another Email Parser
There might be other email parsers for PHP around but I have taken the challenge to write a simple email parser that gives access to the different content types and extracts attachements.
The usage is straight forward.
$emailParser = new EmailParser(file_get_contents('test.eml'));
$emailParser->getBody('text/plain');
$attachements = $emailParser->getAttachements();
Store them somewhere if you like
foreach ($attachements as $a) {
echo 'Saving attachement ' . $a->getFilename() . ' (' . $a->getContentType() . ')';
$a->storeTo('/tmp/');
}