Zend Framework - POP3 - 检索消息源
是否可以使用 Zend Framework 中的 Zend_Mail_Storage_Pop3 检索完整的消息源(类似于 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 对象包含已拆分为字段(即标题、内容等)的消息。有没有办法找回原始消息来源?我希望能够存储它,这样如果我需要使用不同的工具再次解析消息,我将获得必要的信息。
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 tool, I will have the necessary information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
现在我尝试使用以下代码:
For now I'm trying to use the following code: