我需要阅读ZF2项目中的邮件内容。我能够阅读标题和contentType,但不能读取' body'。 contentType = multipart / alternative。到目前为止,我使用以下代码:
$params = array('host' => 'myHost', 'user' => 'myUser', 'password' => 'myPwd');
$mail = new \Zend\Mail\Storage\Imap($params);
$cntMail = $mail->countMessages();
for ($i = $cntMail; $i > 0; $i--) { // reverse order
$message = $mail->getMessage($i);
if (stristr($message->subject, '[Ticket#: I' . 411401 . ']')) {
echo $message->subject . "\n";
echo $message->contentType;
if ($message->isMultipart())
echo 'is multipart';
// here the body
echo $mail->getRawContent($i); //throws an error
exit;
}
任何帮助将不胜感激,Andrea
答案 0 :(得分:0)
我连接到smartermail,显然ZF2无法在smartermail中获取邮件内容......