Class: Mail_IMAP
Source Location: /Mail_IMAP-1.1.0RC2/IMAP.php
<p>Mail_IMAP provides a simplified backend for working with the c-client (IMAP) extension.
Author(s):
Version:
Copyright:
- (c) Copyright 2004, Richard York, All Rights Reserved.
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
$attachFname =
[line 297]
(str) Attachment original file name (if any, if not file name is empty string).
$attachFsize =
[line 290]
(int) Attachment file size in bytes.
$attachFtype =
[line 283]
(str) Attachment MIME type.
$attachHasAttach =
[line 304]
(bool) Attachment has attachments?
$attachPid =
[line 276]
(str) Attachment part id.
$defaultPid =
[line 225]
(str) contains the default PID.
$header =
[line 320]
(array)(mixed) Associative array containing information gathered by imap_headerinfo or imap_rfc822_parse_headers.
$inFname =
[line 254]
(int) Inline file name of the part, if any.
$inFsize =
[line 247]
(int) Inline file size of the part in bytes.
$inFtype =
[line 240]
(str) Inline part MIME type.
$inHasAttach =
[line 261]
(bool) Inline part has attachments?
$inInlineId =
[line 268]
(str) Inline CID for multipart/related.
$inPid =
[line 233]
(str) Inline part id.
$mailbox =
[line 121]
Contains the imap resource stream.
$mailboxInfo =
[line 128]
Contains information about the current mailbox.
$option =
[line 140]
Set flags for various imap_* functions. Use associative indices to indicate the imap_* function to set flags for, create the indice omitting the 'imap_' portion of the function name. see: Mail_IMAP::setOptions for more information.
$rawHeaders =
[line 313]
(str) Contains raw message headers fetched from imap_fetchbody or imap_fetchheader depending on which message part is being retrieved.
Method Detail
Mail_IMAP (Constructor) [line 343]
BOOL|NULL|PEAR_Error Mail_IMAP(
[
$connection = NULL], [int
$options = NULL], [int
$error_reporting = E_ALL], string
$connect)
|
|
Constructor. Optionally set the IMAP resource stream. If IMAP connection arguments are not supplied, returns NULL. Accepts a URI abstraction of the standard imap_open connection argument (see connect) or the imap resource indicator.
Parameters:
alerts [line 1666]
string|FALSE alerts(
[string
$seperator = "<br />\n"])
|
|
Wrapper function for imap_alerts. Implodes the array returned by imap_alerts, (if any) and returns the text.
Parameters:
close [line 552]
PEAR_Error|TRUE close(
[int
$options = NULL])
|
|
Wrapper method for imap_close. Close the IMAP resource stream.
Parameters:
connect [line 422]
PEAR_Error|TRUE connect(
string
$connect, [int
$options = NULL])
|
|
Wrapper method for imap_open. Accepts a URI abstraction in the following format: imap://user:pass@mail.example.com:143/INBOX#notls instead of the standard connection arguments used in imap_open. Replace the protocol with one of pop3|pop3s imap|imaps nntp|nntps. Place intial folder in the file path portion, and optionally append tls|notls|novalidate-cert in the anchor portion of the URL. A port number is optional, however, leaving it off could lead to a serious degradation in preformance. Examples of a well-formed connection argument: For IMAP: imap://user:pass@mail.example.com:143/INBOX For IMAP SSL: imaps://user:pass@example.com:993/INBOX For POP3: pop3://user:pass@mail.example.com:110/INBOX For POP3 SSL: pop3s://user:pass@mail.example.com:993/INBOX For NNTP: nntp://user:pass@mail.example.com:119/comp.test For 'notls' OR 'novalidate-cert' append to the URL as an anchor. For 'tls' use secure protocol and add the 'tls' option to the anchor. Examples: For notls: imap://user:pass@mail.example.com:143/INBOX#notls For tls: imaps://user:pass@mail.example.com:143/INBOX#tls tls no-validate: imaps://user:pass@mail.example.com:143/INBOX#tls/novalidate-cert ssl no-validate: imaps://user:pass@mail.example.com:143/INBOX#novalidate-cert If the username is an email address or contains invalid URL characters, urlencode the username portion of the string before passing it. Use the IMAP.connection_wizard_example.php file to automatically detect the correct URI to pass to this function. This file is located in the examples directory.
Parameters:
convertBytes [line 1584]
string convertBytes(
int
$bytes)
|
|
Converts an integer containing the number of bytes in a file to one of Bytes, Kilobytes, Megabytes, or Gigabytes, appending the unit of measurement. This method may be called statically.
Parameters:
debug [line 1776]
void debug(
[int
$mid = 0])
|
|
Dumps various information about a message for debugging. Mail_IMAP::debug is called automatically from Mail_IMAP::connect if $_GET['dump_mid'] isset and MAIL_IMAP_ERROR_REPORTING == E_ALL || MAIL_IMAP_E_DEBUG. $_GET['dump_pid'] - var_dump the $this->_pid[$mid] variable. $_GET['dump_structure'] - var_dump the structure returned by imap_fetchstructure. $_GET['test_pid'] - output the body returned by imap_fetchbody. Calling on the debugger exits script execution after debugging operations have been completed.
Parameters:
delete [line 1607]
TRUE|PEAR_Error delete(
int
&$mid, [
$separator = "<br />\n"])
|
|
Wrapper function for imap_delete. Sets the marked for deletion flag. Note: POP3 mailboxes do not remember flag settings between connections, for POP3 mailboxes this function should be used in addtion to expunge.
Parameters:
dump [line 1815]
void dump(
&$thing, mixed
$thing)
|
|
Calls on var_dump and outputs with HTML
Parameters:
errors [line 1648]
string|FALSE errors(
[string
$seperator = "<br />\n"])
|
|
Wrapper function for imap_errors. Implodes the array returned by imap_errors, (if any) and returns the error text.
Parameters:
expunge [line 1631]
TRUE|PEAR_Error expunge(
)
|
|
Wrapper function for imap_expunge. Expunges messages marked for deletion.
extractMIME [line 1305]
array|FALSE extractMIME(
int
&$mid, string|array
$MIME)
|
|
Searches all message parts for the specified MIME type. Use getBody with $action option MAIL_IMAP_LITERAL_DECODE to view MIME type parts retrieved. If you need to access the MIME type with filename use normal getBody with no action specified. Returns an array of part ids on success. Returns FALSE if MIME couldn't be found, or on failure.
Parameters:
getBody [line 1124]
array|string|FALSE getBody(
int
&$mid, [string
$pid = '1'], [int
$action = 0], [string
$getPart = 'text/html'], [int
$options = NULL], [
$attempt = 1])
|
|
Searches parts array set in Mail_IMAP::_declareParts() for a displayable message. If the part id passed is message/rfc822 looks in subparts for a displayable body. Attempts to return a text/html inline message part by default. And will automatically attempt to find a text/plain part if a text/html part could not be found. Returns an array containing three associative indices; 'ftype', 'fname' and 'message'. 'ftype' contains the MIME type of the message, 'fname', the original file name, if any, empty string otherwise. And 'message', which contains the message body itself which is returned decoded from base64 or quoted-printable if either of those encoding types are specified, returns untouched otherwise. Returns FALSE on failure.
Parameters:
getDefaultPid [line 1224]
string getDefaultPid(
int
&$mid, [string
$getPart = 'text/html'], [
$attempt = 1])
|
|
Searches structure defined in Mail_IMAP::_declareParts for the top-level default message. Attempts to find a text/html default part, if no text/html part is found, automatically attempts to find a text/plain part. Returns the part id for the default top level message part on success. Returns FALSE on failure.
Parameters:
getHeaders [line 1393]
Array|BOOL getHeaders(
int
&$mid, [
$pid = '0'], [int
$from_length = 1024], [int
$subject_length = 1024], [string
$default_host = NULL], [int
$options = NULL], string
&$pid)
|
|
Set member variable containing header information. Creates an array containing associative indices referring to various header information. Use http://www.php.net/var_dump or http://www.php.net/print_r on the $header member variable to view information gathered by this function. Returns header information on success and FALSE on failure.
Parameters:
getMailboxes [line 1834]
array getMailboxes(
[string
$host = NULL], [
$pattern = '*'])
|
|
Wrapper method for imap_list. Calling on this function will return a list of mailboxes. This method receives the host argument automatically via Mail_IMAP::connect in the $this->mailboxInfo['host'] variable if a connection URI is used.
Parameters:
getMailboxInfo [line 493]
PEAR_Error|TRUE getMailboxInfo(
[
$ret = TRUE], string
$connect, bool
$get_info)
|
|
Adds to the $mailboxInfo member variable information about the current mailbox from imap_mailboxmsginfo. Note: This method is automatically called on by default by connect.
Parameters:
getParts [line 765]
bool getParts(
int
&$mid, int
&$pid, [string
$MIME = 'text/html'], [bool
$getAlternative = TRUE], [bool
$retrieve_all = FALSE])
|
|
sets up member variables containing inline parts and attachments for a specific part in member variable arrays beginning with 'in' and 'attach'. If inline parts are present, sets $inPid, $inFtype, $inFsize, $inHasAttach, $inInlineId (if an inline CID is specified). If attachments are present, sets, $attachPid, $attachFsize, $attachHasAttach, $attachFname (if a filename is present, empty string otherwise). Typically the text/html part is displayed by default by a message viewer, this part is excluded from the inline member variable arrays thourgh $excludeMime by default. If $getInline is TRUE the text/plain alternative part will be returned in the inline array and may be included as an attachment. Useful for mail developement/debugging of multipart messages.
Parameters:
getQuota [line 1685]
array|PEAR_Error getQuota(
[string
$folder = NULL])
|
|
Retreives information about the current mailbox's quota. Rounds up quota sizes and appends the unit of measurment. Returns information in a multi-dimensional associative array.
Parameters:
getRawHeaders [line 1351]
string|FALSE getRawHeaders(
int
&$mid, [string
$pid = '0'], [int
$options = NULL], [bool
$rtn = TRUE])
|
|
Set member variable $rawHeaders to contain Raw Header information for a part. Returns default header part id on success, returns FALSE on failure.
Parameters:
getRawMessage [line 1072]
void getRawMessage(
int
&$mid, [int
$options = NULL])
|
|
Returns entire unparsed message body. See imap_body for options.
Parameters:
messageCount [line 570]
Wrapper method for imap_num_msg.
setFlags [line 1735]
BOOL|PEAR_Error setFlags(
array
$mids, array
$flags, [int
$action = 3], [int
$options = NULL])
|
|
Wrapper function for imap_setflag_full. Sets various message flags. Accepts an array of message ids and an array of flags to be set. The flags which you can set are "\\Seen", "\\Answered", "\\Flagged", "\\Deleted", and "\\Draft" (as defined by RFC2060). Warning: POP3 mailboxes do not remember flag settings from connection to connection.
Parameters:
setOptions [line 527]
PEAR_Error|TRUE setOptions(
array
$option_set, string
$constant)
|
|
Set the $option member variable, which is used to specify optional imap_* function arguments (labeled in the manual as flags or options e.g. FT_UID, OP_READONLY, etc). Example: $msg->setOptions(array('body', 'fetchbody', 'fetchheader'), 'FT_UID'); This results in imap_body, imap_fetchbody and imap_fetchheader being passed the FT_UID option in the flags/options argument where ever these are called on by Mail_IMAP. Note: this method only sets arguments labeled as flags/options.
Parameters:
unsetHeaders [line 1564]
void unsetHeaders(
int
&$mid)
|
|
Destroys variables set by getHeaders.
Parameters:
unsetParts [line 977]
void unsetParts(
integer
&$mid)
|
|
Destroys variables set by getParts and _declareParts.
Parameters:
Documentation generated on Mon, 11 Mar 2019 13:52:29 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|