Class IMP_IMAPClient

Description

The IMP_IMAPClient:: class enables connection to an IMAP server through built-in PHP functions.

TODO: This should eventually be moved to Horde 4.0/framework.

$Horde: imp/lib/IMAP/Client.php,v 1.21.2.36 2009/08/05 08:36:37 slusarz Exp $

Copyright 2005-2009 The Horde Project (http://www.horde.org/)

Based on code from:

  • auth.php (1.49)
  • imap_general.php (1.212)
  • strings.php (1.184.2.35)
from the Squirrelmail project. Copyright 1999-2005 The SquirrelMail Project Team

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.fsf.org/copyleft/gpl.html.

Located in /lib/IMAP/Client.php (line 31)


	
			
Variable Summary
 array $_capability
 string $_currtag
 string $_host
 array $_namespace
 string $_port
 integer $_sessionid
 resource $_stream
 string $_usessl
 string $_usetls
Method Summary
 IMP_IMAPClient IMP_IMAPClient (string $host, string $port, string $protocol)
 array getNamespace ([array $additional = array()])
 mixed login (string $username, string $password)
 void logout ()
 void queryCapability (string $capability, mixed 1)
 boolean searchCharset (string $charset)
 mixed useTLS ()
Variables
array $_capability = null (line 38)

The list of capabilities of the IMAP server.

string $_currtag = null (line 73)

The currently active tag.

string $_host (line 45)

The hostname of the IMAP server to connect to.

array $_namespace = null (line 52)

The namespace information.

string $_port (line 59)

The port number of the IMAP server to connect to.

integer $_sessionid = 1 (line 66)

The unique ID to use when making an IMAP query.

resource $_stream (line 80)

The socket connection to the IMAP server.

string $_usessl = false (line 87)

Are we using SSL to connect to the IMAP server?

string $_usetls = false (line 94)

Are we using TLS to connect to the IMAP server?

Methods
Constructor IMP_IMAPClient (line 103)

Constructor.

IMP_IMAPClient IMP_IMAPClient (string $host, string $port, string $protocol)
  • string $host: The address/hostname of the IMAP server.
  • string $port: The port to connect to on the IMAP server.
  • string $protocol: The protocol string (See, e.g., servers.php).
getNamespace (line 579)

Get the NAMESPACE information from the IMAP server.

  • return: An array with the following format:
     Array
     (
       [foo1] => Array
       (
         [name] => (string)
         [delimiter] => (string)
         [type] => [personal|other|shared] (string)
         [hidden] => (boolean)
       )
    
       [foo2] => Array
       (
         ...
       )
     )
    Returns PEAR_Error object on error.
array getNamespace ([array $additional = array()])
  • array $additional: If the server supports namespaces, any additional namespaces to add to the namespace list that are not broadcast by the server.
login (line 343)

Log the user into the IMAP server.

  • return: True on success, PEAR_Error on error.
mixed login (string $username, string $password)
  • string $username: Username.
  • string $password: Encrypted password.
logout (line 494)

Log out of the IMAP session.

void logout ()
queryCapability (line 545)

Returns whether the IMAP server supports the given capability.

void queryCapability (string $capability, mixed 1)
  • string $capability: The capability string to query. If null, returns the entire capability array.
  • mixed 1: True if the server supports the queried capability, false if it doesn't, or an array if the capability can contain multiple values.
searchCharset (line 657)

Determines whether the IMAP search command supports the optional charset provided.

  • return: True if the IMAP search command supports the charset.
boolean searchCharset (string $charset)
  • string $charset: The character set to test.
useTLS (line 125)

Are we using TLS to connect and is it supported?

  • return: Returns true if TLS is being used to connect, false if is not, and PEAR_Error if we are attempting to use TLS and this version of PHP doesn't support it.
mixed useTLS ()

Documentation generated on Sun, 30 Jan 2011 05:28:09 +0000 by phpDocumentor 1.4.3