我正在尝试下载和同步 imap 电子邮件,但是当我使用 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////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////