2015-09-23 50 views
1

我連接到IMAP郵箱,並試圖創建文件夾收件箱/測試使用PHP和Zend 1.12:的Zend 1.12和IMAP:創建文件夾失敗

$this->Mail = new Zend_Mail_Storage_Imap(array(
        'host'  => $this->sHost, 
        'port'  => $this->nPort, 
        'user'  => $this->sUser, 
        'password' => $this->sPass, 
        'ssl'  => $this->sSsl, 
        'folder' => 'INBOX')); // Works, I can get all messages in INBOX for example 

$allFolders = $this->Mail->getFolders('INBOX'); // Throws 'Zend_Mail_Storage_Exception' with message 'folder not found' 

$this->Mail->createFolder('test', 'INBOX'); // Throws 'Zend_Mail_Storage_Exception' with message 'cannot create folder' 

$Folder = $this->Mail->getFolders()->INBOX; // Works, so INBOX is there 

任何想法可能是錯誤的?

回答

0
$allFolders = $this->Mail->getFolders('INBOX.'); 
$this->Mail->createFolder('INBOX.test'); 

注意INBOX後面的點,這使它工作。