0
我試圖下載和同步imap電子郵件,但是當我用imap_body下載某些消息時,字符串被截斷,它沒有像我期望的那樣檢索整個原始消息,我是否錯過了什麼?這是我的代碼:PHP imap_body被截斷
$raw_headers = imap_fetchheader($imap, $msgno);
$message = $raw_headers;
$message .= imap_body($imap, $msgno);
echo $message;
的一些消息的最後一部分將配件去其截斷,這樣,這個特殊的消息居然有2個附件,但只顯示一個的一部分,可有人請幫我想出解決辦法:
HEADERS GO HERE
This is a multi-part message in MIME format.
------_=_NextPart_001_01CB2F48.59B2C620
Content-Type: multipart/alternative; boundary="----_=_NextPart_002_01CB2F48.59B2C620"
------_=_NextPart_002_01CB2F48.59B2C620
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
PLAIN CONTENT GOES HERE
------_=_NextPart_002_01CB2F48.59B2C620
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
HTML CONTENT GOES HERE
------_=_NextPart_002_01CB2F48.59B2C620--
------_=_NextPart_001_01CB2F48.59B2C620
Content-Type: application/vnd.ms-excel; name="HPHS burnett,gJul14.xls"
Content-Transfer-Encoding: base64
Content-Description: HPHS burnett,gJul14.xls
Content-Disposition: attachment; filename="HPHS burnett,gJul14.xls"
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAACAAAAkAAAAAAAAAAA
EAAAjAAAAAEAAAD+////AAAAAJIAAACRAAAA////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////
我希望能夠保存整個原始消息,與imap_savebody我仍然弄清楚哪部分得到... – MikeGA 2012-01-03 04:25:40
OMG!調用這個沒有零件號碼的函數會得到整個消息沒有任何問題! – MikeGA 2012-01-03 04:37:17
imap_savebody($ imap,'test.txt',$ msgno); //這工作! – MikeGA 2012-01-03 04:38:10