我已经写了php代码来读取电子邮件。我正在使用
imap_fetchbody($this->conn, $i, 1.2);
显示电子邮件消息。当邮件是与附件,它显示在良好的礼仪,但如果电子邮件是没有附件,它显示什么。当我使用
时$body = imap_fetchbody($this->conn, $i, 1);
消息以文本/普通格式显示。这样的
this is system generated mail -- Regards! Md Belal
当我使用
时$body = imap_body($this->conn, $i);
显示如下
--047d7b5d2f88ddb36c050069a175 Content-Type: text/plain; charset=UTF-8 this is system generated mail -- Regards! Md Belal 8287326270 --047d7b5d2f88ddb36c050069a175 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
this is system generated mail
--
Regards!
Md Belal
--047d7b5d2f88ddb36c050069a175--
我需要有礼貌地展示它。这样的。
this is system generated mail
--
Regards!
Md Belal
该怎么做,请帮忙。谢谢!
试试这个https://stackoverflow.com/a/14936048/2289510
btw我还没有尝试过,但nl2br (http://hu1.php.net/nl2br)可能也可以帮助你,它添加换行时,你的结果是在文本/纯格式和它包含'n 'r字符。