Class: Mail_IMAP
Source Location: /Mail_IMAP-1.0.0RC3/IMAP.php
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
Method Detail
Mail_IMAP (Constructor) [line 294]
BOOL|NULL|PEAR_Error Mail_IMAP(
[
$connection = NULL], [int
$options = NULL], 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 1441]
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 406]
PEAR_Error|TRUE close(
[int
$options = NULL])
|
|
Wrapper method for imap_close. Close the IMAP resource stream.
Parameters:
connect [line 358]
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 1359]
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.
Parameters:
delete [line 1382]
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:
errors [line 1423]
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 1406]
TRUE|PEAR_Error expunge(
)
|
|
Wrapper function for imap_expunge. Expunges messages marked for deletion.
extractMIME [line 1088]
array|FALSE extractMIME(
int
&$mid, string
$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 916]
array|string|FALSE getBody(
int
&$mid, string
$pid, [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 1011]
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 1171]
BOOL getHeaders(
int
&$mid, string
&$pid, [int
$from_length = 1024], [int
$subject_length = 1024], [string
$default_host = NULL], [int
$options = NULL])
|
|
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.
Parameters:
getParts [line 619]
bool getParts(
int
&$mid, int
&$pid, [string
$MIME = 'text/html'], [bool
$getAlternative = TRUE])
|
|
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 1460]
array|PEAR_Error getQuota(
[string
$folder = 'INBOX'])
|
|
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 1133]
string|FALSE getRawHeaders(
int
&$mid, string
$pid, [int
$options = NULL])
|
|
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 869]
void getRawMessage(
int
&$mid, [int
$options = NULL])
|
|
Returns entire unparsed message body. See imap_body for options.
Parameters:
messageCount [line 427]
Wrapper method for imap_num_msg. Calling on this function will reset the IMAP error stack (if mailbox is empty). imap_errors is called to supress a NOTICE level error, mailbox is empty, which isn't an error state. For debugging, comment out the call to imap_errors.
setFlags [line 1501]
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:
unsetHeaders [line 1342]
void unsetHeaders(
int
&$mid)
|
|
Destroys variables set by getHeaders.
Parameters:
unsetParts [line 774]
void unsetParts(
integer
&$mid)
|
|
Destroys variables set by getParts and _declareParts.
Parameters:
Documentation generated on Mon, 11 Mar 2019 10:15:02 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|