使用imap_fetchbody检索html [英] Retrieve html using imap_fetchbody

查看:218
本文介绍了使用imap_fetchbody检索html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用imap检索电子邮件。它工作正常罚款为纯文本。但问题得到html,我使用 imap_fetchbody($ connections,$ email_number,1.2); 但它不工作。它返回null。但如果我尝试 imap_fetchbody($ connections,$ email_number,1.1); 这是纯文本,我得到 *

解决方案

PHP规格

  string imap_fetchbody(resource $ imap_stream,int $ msg_number,string $ section [,int $ options = 0])

只要记住,数字应该是字符串而不是整数,因此您的命令将是

  imap_fetchbody($ connections,$ email_number,1.2); 

希望这可以解决您的问题


i am using imap to retrieve emails. It works fine for fine for plain text. But problem getting html, I use imap_fetchbody($connections,$email_number,1.2); but it does not work. It returns null. But if I try imap_fetchbody($connections,$email_number,1.1); which is for plain text I get * instead of html tag.

I appreciate any help

解决方案

As per PHP specifications

 string imap_fetchbody ( resource $imap_stream , int $msg_number , string $section [, int $options = 0 ] )

Just Remember that the number should be the string not the integer thus your command would be

 imap_fetchbody($connections,$email_number,"1.2");

Hope this would resolve your problem

这篇关于使用imap_fetchbody检索html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆