Zend Framework - POP3 - retrieving message source
Is it possible to retrieve the complete message source (similar tu Unix Mbox format) using Zend_Mail_Storage_Pop3 from the Zend Framework?
I'm using the following code to retrieve messages:
$mail = new Zend_Mail_Storage_Pop3(array('host' => 'localhost',
'user' => 'test',
'password' => 'test'));
echo $mail->countMessages() . " messages found\n";
foreach ($mail as $message) {
echo "Mail from '{$message->from}': {$message->subject}\n";
}
It looks like the $mail object contains the message already split up into fields (ie. headers, contents, etc.). Is there any way to retrieve the original message source? I would like to be able to store it so if I need to parse the message again using a different too开发者_如何学Cl, I will have the necessary information.
For now I'm trying to use the following code:
<?php
foreach ($mail as $messageNumber => $message) {
echo $mail->getRawHeader($messageNumber);
echo $mail->getRawContent($messageNumber);
}
?>
精彩评论