Class Gadget_Mail

Description

Gadget_Mail

Gadget::Mail is an yet ordinary though sophisticated interface to IMAP Mailboxes, which supports all common tasks such as folder listing and traversal as well as message retreival and storage. The companion classes Gadget_Mail_Message and Gadget_Mail_Attechment operate as simple interfaces to messages and mail attachments.

  • since: 1.0

Located in /Gadget/Mail.php (line 44)


	
			
Variable Summary
string $account
bool $connected
array $folders
array $headers
resource $imap
array $messages
array $options
string $password
Method Summary
Gadget_Mail Gadget_Mail ([string $account = null], [string $password = null], [array $options = array()])
mixed connect ([string $folder = null])
string connectionString ([string $folder = ''], [string $append = ''])
mixed countAll ([string $folder = null], [bool $refresh = false])
mixed countNew ([mixed $folder = null], [bool $refresh = false], string $fodler)
mixed countRecent ([string $folder = null], [bool $refresh = false])
mixed createFolder (string $name, [string $in = 'INBOX'])
mixed currentFolder ([bool $refresh = false])
string decodeMIME (string $mime)
string decodeUTF7 (string $utf_7, [string $to = GADGET_CHARSET])
mixed deleteFolder (string $name, [string $in = 'INBOX'])
mixed deleteMessage (int $id, [bool $trash = true])
void disconnect ()
mixed emptyFolder ([string $folder = null])
string encodeUTF7 (string $string, [string $from = GADGET_CHARSET])
mixed expungeFolder ([string $folder = null])
mixed getFolder ([string $folder = null], [bool $refresh = false])
mixed getHeaders (int $id, [bool $refresh = false])
mixed &getMessage (int $id, [bool $refresh = false])
mixed getQuota ([string $folder = null], [bool $refresh = false])
mixed getSortedIds ([int $sort = SORTDATE], [int $reverse = 1])
mixed getThreadedIds ([int $flags = null])
mixed listFolders ([bool $refresh = false])
mixed listHeaders ([int $sort = SORTDATE], [int $reverse = 1], mixed $offset, [mixed $limit = -1], [bool $refresh = false])
mixed moveMessage (int $id, string $folder)
object PEAR_Error raiseError (string $error, int $code, [bool $le = false])
mixed sendMessage (object Gadget_Mail_Message &$message, string $mode)
mixed setFolder (string $folder, [bool $refresh = false])
void setOptions (array $options)
object Gadget_Mail &singleton (string $account, string $passwd, [array $options = array()])
mixed storeMessage (string $rawmessage, [string $folder = 'INBOX.Drafts'], [string $flags = '\\Seen'])
mixed subscribeFolder (string $name, [mixed $in = 'INBOX'])
Variables
string $account (line 52)

Account (someone@example.com)

  • access: public
bool $connected (line 68)

Connected

  • access: public
array $folders = array() (line 91)

Folders

  • access: protected
array $headers = array(
'INBOX' => array(),)
(line 99)

Headers

  • access: protected
resource $imap (line 119)

IMAP Resource

  • access: protected
array $messages = array(
'INBOX' => array(),)
(line 109)

Messages

  • access: protected
array $options = array(
'host' => 'localhost',
'port' => 143,
'proto' => 'imap',
'ssl' => '',
'folder'=> 'INBOX',
'list' => 0,
)
(line 76)

Options

  • access: protected
string $password (line 60)

Password

  • access: public
Methods
Constructor Gadget_Mail (line 129)

Constructor

  • access: public
Gadget_Mail Gadget_Mail ([string $account = null], [string $password = null], [array $options = array()])
  • string $account
  • string $password
  • array $options
connect (line 358)

Connect

  • return: Returns true on success or PEAR_Error on failure.
  • access: protected
mixed connect ([string $folder = null])
  • string $folder
connectionString (line 187)

Get Connection String

  • access: public
string connectionString ([string $folder = ''], [string $append = ''])
  • string $folder
  • string $append
countAll (line 440)

Count All Messages

  • return: Returns count of messages in the specified or current folder on success or PEAR_Error on failure.
  • access: public
mixed countAll ([string $folder = null], [bool $refresh = false])
  • string $folder
  • bool $refresh
countNew (line 463)

Count New Messages

  • return: Returns count of new messages in the specified or current folder on success or PEAR_Error on failure.
  • access: public
mixed countNew ([mixed $folder = null], [bool $refresh = false], string $fodler)
  • string $fodler
  • bool $refresh
countRecent (line 486)

Count Recent Messages

  • return: Returns count of recent messages in the specified or current folder on success or PEAR_Error on failure.
  • access: public
mixed countRecent ([string $folder = null], [bool $refresh = false])
  • string $folder
  • bool $refresh
createFolder (line 726)

Create Folder

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed createFolder (string $name, [string $in = 'INBOX'])
  • string $name
  • string $in
currentFolder (line 584)

Current Folder

  • return: Returns name of current folder on success or PEAR_Error on failure.
  • access: public
mixed currentFolder ([bool $refresh = false])
  • bool $refresh
decodeMIME (line 342)

Mime Helper

  • access: public
  • static:
string decodeMIME (string $mime)
  • string $mime
decodeUTF7 (line 284)

Decode UTF-7

  • access: public
string decodeUTF7 (string $utf_7, [string $to = GADGET_CHARSET])
  • string $utf_7
  • string $to
deleteFolder (line 747)

Delete Folder

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed deleteFolder (string $name, [string $in = 'INBOX'])
  • string $name
  • string $in
deleteMessage (line 791)

Delete Message

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed deleteMessage (int $id, [bool $trash = true])
  • int $id
  • bool $trash
disconnect (line 385)

Disconnect

  • access: public
void disconnect ()
emptyFolder (line 866)

Empty

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed emptyFolder ([string $folder = null])
  • string $folder
encodeUTF7 (line 220)

Encode UTF-7

  • access: public
string encodeUTF7 (string $string, [string $from = GADGET_CHARSET])
  • string $string
  • string $from
expungeFolder (line 851)

Expunge

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed expungeFolder ([string $folder = null])
  • string $folder
getFolder (line 562)

Get Folder

  • return: Returns the object of the specified or current folder on success or PEAR_Error on failure.
  • access: public
mixed getFolder ([string $folder = null], [bool $refresh = false])
  • string $folder
  • bool $refresh
getHeaders (line 701)

Get Headers

  • return: Returns requested message headers on success or PEAR_Error on failure.
  • access: public
mixed getHeaders (int $id, [bool $refresh = false])
  • int $id
  • bool $refresh
getMessage (line 676)

Get Message

  • return: Returns requested Gadget_Mail_Message on success or PEAR_Error on failure.
  • access: public
mixed &getMessage (int $id, [bool $refresh = false])
  • int $id
  • bool $refresh
getQuota (line 509)

Get Quota

  • return: Returns array of quotas (size/msgs) of the specified or current folder on success or PEAR_Error on failure.
  • access: public
mixed getQuota ([string $folder = null], [bool $refresh = false])
  • string $folder
  • bool $refresh
getSortedIds (line 601)

Get Sorted Ids

  • return: Returns array of sorted message ids on success or PEAR_Error on failure.
  • access: public
mixed getSortedIds ([int $sort = SORTDATE], [int $reverse = 1])
  • int $sort
  • int $reverse
getThreadedIds (line 620)

Get Threaded Ids

  • return: Returns array of threaded (by References header) message ids on success or PEAR_Error on failure.
  • access: public
mixed getThreadedIds ([int $flags = null])
  • int $flags
listFolders (line 401)

List Folders

  • return: Returns array of folders on success or PEAR_Error on failure.
  • access: public
mixed listFolders ([bool $refresh = false])
  • bool $refresh
listHeaders (line 645)

List Headers

  • return: Returns list of headers of the current folder on success or PEAR_Error on failure.
  • access: public
mixed listHeaders ([int $sort = SORTDATE], [int $reverse = 1], mixed $offset, [mixed $limit = -1], [bool $refresh = false])
  • int $sort
  • int $reverse
  • bool $refresh
moveMessage (line 826)

Move Message

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed moveMessage (int $id, string $folder)
  • int $id
  • string $folder
raiseError (line 207)

Raise Error

  • access: protected
object PEAR_Error raiseError (string $error, int $code, [bool $le = false])
  • string $error
  • int $code
  • bool $le
sendMessage (line 897)

Send Message

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed sendMessage (object Gadget_Mail_Message &$message, string $mode)
setFolder (line 531)

Set Folder

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed setFolder (string $folder, [bool $refresh = false])
  • string $folder
  • bool $refresh
setOptions (line 144)

Set Options

  • access: public
void setOptions (array $options)
  • array $options
singleton (line 169)

Singleton

  • access: public
  • static:
object Gadget_Mail &singleton (string $account, string $passwd, [array $options = array()])
  • string $account
  • string $passwd
  • array $options
storeMessage (line 915)

Store Message

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed storeMessage (string $rawmessage, [string $folder = 'INBOX.Drafts'], [string $flags = '\\Seen'])
  • string $rawmessage
  • string $folder
  • string $flags
subscribeFolder (line 770)

Subscribe to Folder

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed subscribeFolder (string $name, [mixed $in = 'INBOX'])
  • string $name

Documentation generated on Sun, 03 Jul 2005 12:45:51 +0200 by phpDocumentor 1.3.0RC3