开发者

Zend Framework - POP3 - retrieving message source

开发者 https://www.devze.com 2022-12-26 18:18 出处:网络
Is it possible to retrieve the complete message source (similar tu Unix Mbox format) using Zend_Mail_Storage_Pop3 from the Zend Framework?

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

精彩评论

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