0
如何獲取電子郵件的身體..獲取電子郵件imap_fetchbody()的身體
有了這個例子中只有約25%的所有電子郵件體被取出!?
$structure = imap_fetchstructure($this->stream, $header->msgno);
if(!empty($structure->parts[1])){
$message = imap_fetchbody($this->stream, $header->msgno, '1');
switch($structure->parts[1]->encoding){
case 1:
$message = imap_8bit($message);
break;
case 3:
$message = imap_base64($message);
break;
case 4:
$message = imap_qprint($message);
break;
}
echo $message;
}
更新
// gets 35 of 131
$message = imap_fetchbody($this->stream, $header->msgno, '1');
// gets 10 of 131
$message = imap_fetchbody($this->stream, $header->msgno, '1.2');
「的所有電子郵件正文的25%」?你得到所有的消息,但只有每條消息的1/4?或16條消息,你只能得到4? – 2014-12-04 21:39:32
用$ message = imap_fetchbody($ mailbox,$ email,1.2)試試吧。擺脫其他東西進行測試 – unixmiah 2014-12-04 21:39:42
更改'1.1'到'1.2',並試一試 – unixmiah 2014-12-04 21:40:29