3
我正在为阅读邮件写一个简单的php脚本。php imap阅读正文消息
当我中提取邮件体:
imap_body($mbox, $i);
我回来了这样的事情:
--0016e6db2b334d4d7904a883f4ec
Content-Type: text/plain; charset=ISO-8859-1
<The message arrived>
--0016e6db2b334d4d7904a883f4ec
Content-Type: text/html; charset=ISO-8859-1
<The message arrived>
--0016e6db2b334d4d7904a883f4ec--
如何我只能提取? 我正在使用php_imap。
谢谢。
问题是,整个字符串由imap_body印刷($ MBOX,$ⅰ); – michele
你尝试过fetch_body()吗? 'imap_fetchbody(resource $ imap_stream,int $ msg_number,string $ section [,int $ options = 0])' 该部分是您可以发送以获取主体的参数。 – serialworm
这可能有所帮助。 http://stackoverflow.com/questions/5177772/how-to-use-imap-in-php-to-fetch-mail-body-content – serialworm