This can be done using the Zend_Mail component in the Zend Framework.
Perhaps this example, which can also be found in the documentation, helps:
// get the first none multipart part $part = $message; while ($part->isMultipart()) { $part = $message->getPart(1); } echo 'Type of this part is ' . strtok($part->contentType, ';') . "\n"; echo "Content:\n"; echo $part->getContent();
I donโt know how you can tell Zend Mail to read the lines, maybe there is some kind of work necessary for this, but then you will have a fully functional library that will do what you want, and a few more topics reading, etc. d.).
Edit
I only have a second look at it and realized that all you need to do is write your own storage implementation (subclass Zend_Mail_Storage_Abstract), which is not so difficult to do.
I think the cleanest solution you will get, although it takes a bit of effort to make it work.
If you are looking for a faster โdirtyโ solution, someone can help you.
Hope this helps.
source share