【问题标题】:Zend Framework - POP3 - retrieving message sourceZend Framework - POP3 - 检索消息源
【发布时间】:2011-02-05 19:31:52
【问题描述】:

是否可以使用 Zend Framework 中的 Zend_Mail_Storage_Pop3 检索完整的消息源(类似 tu Unix Mbox 格式)?

我正在使用以下代码来检索消息:

  $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";
  }

看起来 $mail 对象包含的消息已被拆分为多个字段(即标题、内容等)。有没有办法检索原始消息源?我希望能够存储它,因此如果我需要使用不同的工具再次解析消息,我将获得必要的信息。

【问题讨论】:

    标签: php zend-framework email pop3 mbox


    【解决方案1】:

    现在我正在尝试使用以下代码:

    <?php
    foreach ($mail as $messageNumber => $message) {
        echo $mail->getRawHeader($messageNumber);
        echo $mail->getRawContent($messageNumber);
    }
    ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-12
      相关资源
      最近更新 更多