Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何读取imap打开的文件夹?_Php_Imap - Fatal编程技术网

Php 如何读取imap打开的文件夹?

Php 如何读取imap打开的文件夹?,php,imap,Php,Imap,我必须按文件夹显示电子邮件。我试过: $this->conn = imap_open('{'.$this->server.':'.$this->string.'}'.$folder, $this->username, $this->password); 如果$folder是收件箱或“”,这没关系,但当我尝试列出的文件夹名称时,如草稿,imap返回“邮箱不存在,或必须订阅。”。 我做错了什么?好的,谢谢Max的评论 常规电子邮件:imap_open(“{.$this

我必须按文件夹显示电子邮件。我试过:

$this->conn = imap_open('{'.$this->server.':'.$this->string.'}'.$folder, $this->username, $this->password);
如果
$folder
收件箱
”,这没关系,但当我尝试列出的文件夹名称时,如
草稿
,imap返回
“邮箱不存在,或必须订阅。”。


我做错了什么?

好的,谢谢Max的评论

常规电子邮件:
imap_open(“{.$this->server.”:“.$this->string.”收件箱“.$f,$this->username,$this->password)

Gmail:
imap\u打开('{.$this->server'.:'.$this->string'.}.$f,$this->username,$this->password)


全名:
[Gmail]/Trash

imap\u重新打开返回:无法打开邮箱草稿:没有这样的邮箱。它是什么服务器?如果是Gmail,文件夹的名称类似于“[Gmail]/Drafts”。您应该执行LIST命令来查看邮箱的实际名称。好的,问题解决了一半。普通邮件需要“收件箱”,但我怎么才能打开Gmail邮箱呢?