开发者

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);
}
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜