我使用Zend Mail来获取我的POP3服务器中的电子邮件列表,并将其显示在网页上。这里是我的代码:Zend邮件内容
<?
require("Zend/Mail/Storage/Pop3.php");
$mail = new Zend_Mail_Storage_Pop3(array('host' => 'localhost',
'user' => 'person',
'password' => 'awesome'));
// show the mail!
echo "You have " . $mail->countMessages() . " messages! <br><br>";
foreach ($mail as $message) {
echo "From: '{$message->from}'<br> Subject: {$message->subject}<br>";
echo "Content: " . $message->getContent() . "<br><br>";
}
?>
的问题是,一些email都出现了这样的:
From: 'Trey '
Subject: WOMBATS WOMBATS
Content: --Apple-Mail-1--609821059 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii SWIMMING IN THE OCEAN CAUSIN' A COMOTION CUZ THEY SUCK --Apple-Mail-1--609821059 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii SWIMMING IN THE OCEAN
CAUSIN' A COMOTION
CUZ THEY
SUCK
--Apple-Mail-1--609821059--
这使得它难以阅读邮件的实际主体内容。我想让它看起来像这样:
From: 'Stan Flusterflap '
Subject: hi
Content: hi
我该如何去做这件事?谢谢。
你可能想要做一些有关整个袋熊虫感染的事情。 – Charles 2011-04-04 05:15:07