Horde_Imap_Client_Base::createMailbox PHP Method

createMailbox() public method

Create a mailbox.
public createMailbox ( mixed $mailbox, array $opts = [] )
$mailbox mixed The mailbox to create. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
$opts array Additional options: - special_use: (array) An array of special-use flags to mark the mailbox with. The server MUST support RFC 6154.
    public function createMailbox($mailbox, array $opts = array())
    {
        $this->login();
        if (!$this->_capability('CREATE-SPECIAL-USE')) {
            unset($opts['special_use']);
        }
        $this->_createMailbox(Horde_Imap_Client_Mailbox::get($mailbox), $opts);
    }

Usage Example

Example #1
0
 /**
  * Creates a new mailbox.
  *
  * @param string $user    The name of the mailbox to create.
  * @param string $domain  The name of the domain in which to create the
  *                        mailbox.
  *
  * @throws Vilma_Exception
  */
 public function createMailbox($user, $domain)
 {
     try {
         $this->_imap->createMailbox($this->_params['userhierarchy'] . $user . '@' . $domain);
     } catch (Exception $e) {
         throw new Vilma_Exception($e);
     }
 }
All Usage Examples Of Horde_Imap_Client_Base::createMailbox