我正在尝试从IMAP服务器获取邮箱,但imap_getmailboxes总是返回false。
这是我的代码:
public function getMailboxes($search = "*") {
$arr = array();
if($t = imap_getmailboxes($this->getImapStream(), $this->imapPath, $search)) {
foreach($t as $item) {
$arr[] = array(
"fullpath" => $item->name,
"attributes" => $item->attributes,
"delimiter" => $item->delimiter,
"shortpath" => substr($item->name, strlen($this->imapPath) - strlen("INBOX")),
);
}
} else {
var_dump(imap_last_error());
var_dump($t);
}
return $arr;
}
$this->getImapStream()
和$this->imapPath
是正确的,因为我在其他功能上使用它们来获取邮件和邮箱信息(有工作功能)。
有人有主意吗?
最诚挚的问候