imap_subscribe

(PHP 3, PHP 4, PHP 5)

imap_subscribe -- Subscribe to a mailbox

Description

bool imap_subscribe ( resource imap_stream, string mbox )

Subscribe to a new mailbox.

如果成功则返回 TRUE,失败则返回 FALSE

See also: imap_unsubscribe().


add a note add a note User Contributed Notes
ajflorido dot canariastelecom.com
17-Mar-2003 02:11
Hello there! Sorry for my english
For someone who need to use this function.
I was trying to use it on my own imap server v2.0 but it didn't subscribe to any of the folders, so i try this method and it works.

class imap {
 var $imaphost="{your.imap.host:143}";
 var $imapuser="user";
 var $imappass="pass";
}

$imapm = new imap();

$mbox=imap_open($imapm->imaphost,$imapm->imapuser,$imapm->imappass);

$bool=imap_subscribe($mbox,"{your.host:143}INBOX");
  if ($bool)
  {
     print "Ok";
  } else {
           print "No ok";
           }