本文整理汇总了PHP中imap_deletemailbox函数的典型用法代码示例。如果您正苦于以下问题:PHP imap_deletemailbox函数的具体用法?PHP imap_deletemailbox怎么用?PHP imap_deletemailbox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了imap_deletemailbox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteAccount
function deleteAccount($_hookValues)
{
$username = $_hookValues['account_lid'];
$imapAdminUsername = $this->profileData['imapAdminUsername'];
$imapAdminPW = $this->profileData['imapAdminPW'];
if ($mbox = @imap_open($this->getMailboxString(), $imapAdminUsername, $imapAdminPW)) {
$mailBoxName = "user.{$username}";
// give the admin account the rights to delete this mailbox
if (imap_setacl($mbox, $mailBoxName, $imapAdminUsername, "lrswipcda")) {
if (imap_deletemailbox($mbox, imap_utf7_encode("{" . $this->profileData['imapServer'] . "}{$mailBoxName}"))) {
return true;
} else {
// not able to delete mailbox
return false;
}
} else {
// not able to set acl
return false;
}
} else {
// imap open failed
return false;
}
}
示例2: deleteMailbox
/**
* Wrapper for imap_deletemailbox().
* @param $mailbox
* @return bool
*/
public function deleteMailbox($mailbox)
{
return imap_deletemailbox($this->connection->getConnection(), $mailbox);
}
示例3: imap_deletemailbox
function imap_deletemailbox($_folderName)
{
$mailboxString = ExecMethod('emailadmin.bo.getMailboxString', $_folderName, 3, $this->profileID);
@imap_unsubscribe($this->mbox, $mailboxString);
$result = imap_deletemailbox($this->mbox, $mailboxString);
#print imap_last_error();
return $result;
}
示例4: mailbox_delete
/**
* mailbox_delete()
* Delete a mailbox from the server.
*/
function mailbox_delete($mailbox)
{
if ($this->connection == 0) {
return false;
}
if (!imap_deletemailbox($this->connection, "\\{{$this->server}:{$this->port}}{$mailbox}")) {
if ($this->debug) {
echo "We had problems deleting the mailbox: {$mailbox}<br>";
echo implode("<br />\n", imap_errors());
}
return false;
}
return true;
}
示例5: deletemailbox
public function deletemailbox($folder)
{
return imap_deletemailbox($this->imapStream, $this->getAccountVar('cnx') . $folder);
}
示例6: DeleteFolder
/**
* Deletes a folder
*
* @param string $id
* @param string $parent is normally false
*
* @access public
* @return boolean status - false if e.g. does not exist
* @throws StatusException could throw specific SYNC_FSSTATUS_* exceptions
*
*/
public function DeleteFolder($id, $parentid)
{
$imapid = $this->getImapIdFromFolderId($id);
if ($imapid) {
return imap_deletemailbox($this->mbox, $this->server . $imapid);
}
return false;
}
示例7: deleteMailbox
public function deleteMailbox(Mailbox $mailbox)
{
if (false === imap_deletemailbox($this->resource, $this->server . $mailbox->getName())) {
throw new Exception('Mailbox ' . $mailbox->getName() . ' could not be deleted');
}
$this->mailboxes = $this->mailboxNames = null;
}
示例8: delete_mailbox
/**
* Delete a mailbox
*
* @param string $folder
* @return bool
* @access public
*/
function delete_mailbox($folder)
{
if ($this->protocol == 'POP3') {
$this->errors[] = GM_NO_POP3_SUPPORT;
return false;
}
if ($this->use_native) {
$mailbox = "\\{{$this->host}}INBOX.{$folder}";
$res = imap_deletemailbox($this->mailer, $mailbox);
if (!$res) {
$this->errors[] = imap_last_error();
return false;
}
} elseif ($this->protocol == 'IMAP') {
$res = $this->mailer->deleteMailbox($folder);
if ($res !== true) {
return false;
}
}
return true;
}
示例9: deleteMailbox
public function deleteMailbox($mailbox)
{
return imap_deletemailbox($this->stream, $mailbox);
}
示例10: createMailBox
function createMailBox($name, $id)
{
$srv = getUsrMailData($id);
$mbox = mail_login($srv["msrv"], $srv["port"], $srv["postf"], $srv["mailuser"], $srv["kennw"], $srv["proto"], $srv["ssl"]);
$name1 = $name;
$name2 = imap_utf7_encode($name);
$newname = $name1;
echo "Newname will be '{$name1}'<br>\n";
# we will now create a new mailbox "phptestbox" in your inbox folder,
# check its status after creation and finaly remove it to restore
# your inbox to its initial state
if (@imap_createmailbox($mbox, imap_utf7_encode("{" . $srv["msrv"] . "}INBOX.{$newname}"))) {
$status = @imap_status($mbox, "{" . $srv["msrv"] . "}INBOX.{$newname}", SA_ALL);
if ($status) {
print "your new mailbox '{$name1}' has the following status:<br>\n";
print "Messages: " . $status->messages . "<br>\n";
print "Recent: " . $status->recent . "<br>\n";
print "Unseen: " . $status->unseen . "<br>\n";
print "UIDnext: " . $status->uidnext . "<br>\n";
print "UIDvalidity:" . $status->uidvalidity . "<br>\n";
if (imap_renamemailbox($mbox, "{" . $srv["msrv"] . "}INBOX.{$newname}", "{your.imap.host}INBOX.{$name2}")) {
echo "renamed new mailbox from '{$name1}' to '{$name2}'<br>\n";
$newname = $name2;
} else {
print "imap_renamemailbox on new mailbox failed: " . imap_last_error() . "<br>\n";
}
} else {
print "imap_status on new mailbox failed: " . imap_last_error() . "<br>\n";
}
if (@imap_deletemailbox($mbox, "{" . $srv["msrv"] . "}INBOX.{$newname}")) {
print "new mailbox removed to restore initial state<br>\n";
} else {
print "imap_deletemailbox on new mailbox failed: " . implode("<br>\n", imap_errors()) . "<br>\n";
}
} else {
print "could not create new mailbox: " . implode("<br>\n", imap_errors()) . "<br>\n";
}
imap_close($mbox);
}
示例11: delete
/**
* Delete the specified folder.
*
* @param string $folder The folder to delete.
*
* @return NULL
*/
public function delete($folder)
{
$result = imap_deletemailbox($this->getBackend(), $this->_getBaseMbox() . $this->encodePath($folder));
if (!$result) {
throw new Horde_Kolab_Storage_Exception(sprintf(Horde_Kolab_Storage_Translation::t("Deleting folder %s failed.") . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $this->_getBaseMbox() . $folder, imap_last_error()));
}
}
示例12: deletemailbox
function deletemailbox($stream, $mailbox)
{
$this->folder_list_did_change();
$mailbox = $this->utf7_encode($mailbox);
return imap_deletemailbox($stream, $mailbox);
}
示例13: removeFolder
/**
* Remove a folder
*
* @param string name
* @return void
* @throws peer.mail.MessagingException
*/
public function removeFolder($name)
{
if (!imap_deletemailbox($this->_hdl[0], $this->_hdl[1] . $name)) {
throw new \peer\mail\MessagingException('Deleting mailbox failed', $this->_errors());
}
$this->cache->remove(SKEY_FOLDER . $name);
}
示例14: deleteMailbox
/**
* Deletes mailbox
*
* @param string $name
* @throws DriverException
*/
public function deleteMailbox($name)
{
if (!imap_deletemailbox($this->resource, $this->server . $name)) {
throw new DriverException("Cannot delete mailbox '{$name}': " . imap_last_error());
}
}
示例15: removeFolder
/**
* remove folder
*
* @return bool success or not
* @param $name of the folder
*/
public function removeFolder($name)
{
return imap_deletemailbox($this->imap, $this->mailbox . $name);
}