Takes an array of address objects, as returned by imap_headerinfo(), for example, and passes each of them through MIME::addrObject2String().
string
addrArray2String
(array $addresses, [mixed $filter = ''])
-
array
$addresses: The array of address objects.
-
mixed
$filter: A user@example.com style bare address to ignore. If any address matches $filter, it will not be included in the final string.
Takes an address object, as returned by imap_header() for example, and formats it as a string.
Object format for the address "John Doe <john_doe@example.com>" is:
$object->personal = Personal name ("John Doe")
$object->mailbox = The user's mailbox ("john_doe")
$object->host = The host the mailbox is on ("example.com")
string
addrObject2String
(stdClass $ob, [mixed $filter = ''])
-
stdClass
$ob: The address object to be turned into a string.
-
mixed
$filter: A user@example.com style bare address to ignore. Either single string or an array of strings. If the address matches $filter, an empty string will be returned.
Returns the bare address.
mixed
bareAddress
(string $address, [string $defserver = null], [boolean $multiple = false])
-
string
$address: The address string.
-
string
$defserver: The default domain to append to mailboxes.
-
boolean
$multiple: Should we return multiple results?
Decodes an RFC 2047-encoded string.
string
decode
(string $string, [string $to_charset = null])
-
string
$string: The text to decode.
-
string
$to_charset: The charset that the text should be decoded to.
Decodes an RFC 2047-encoded address string.
string
decodeAddrString
(string $string, [string $to_charset = null])
-
string
$string: The text to decode.
-
string
$to_charset: The charset that the text should be decoded to.
Decodes an RFC 2231-encoded string.
array
decodeRFC2231
(string $string, [string $to_charset = null])
-
string
$string: The entire string to decode, including the parameter name.
-
string
$to_charset: The charset the text should be decoded to.
Encodes a string containing non-ASCII characters according to RFC 2047.
string
encode
(string $text, [string $charset = null])
-
string
$text: The text to encode.
-
string
$charset: The character set of the text.
Encodes a string containing email addresses according to RFC 2047.
This differs from MIME::encode() because it keeps email addresses legal, only encoding the personal information.
string
encodeAddress
(string $addresses, [string $charset = null], [string $defserver = null])
-
string
$addresses: The email addresses to encode.
-
string
$charset: The character set of the text.
-
string
$defserver: The default domain to append to mailboxes.
Encodes a string pursuant to RFC 2231.
array
encodeRFC2231
(string $name, string $string, string $charset, [string $lang = null])
-
string
$name: The parameter name.
-
string
$string: The string to encode.
-
string
$charset: The charset the text should be encoded with.
-
string
$lang: The language to use when encoding.
Returns the MIME encoding for the given input.
mixed
encoding
(mixed $input, [integer $format = null])
-
mixed
$input: Either the MIME code or encoding string.
-
integer
$format: If MIME_CODE, return code. If MIME_STRING, returns lowercase string. If not set, returns the opposite value.
Generates a Message-ID string conforming to RFC 2822 [3.6.4] and the standards outlined in 'draft-ietf-usefor-message-id-01.txt'.
void
generateMessageID
(string 0)
-
string
0: A message ID string.
Determines if a string contains 8-bit (non US-ASCII) characters.
boolean
is8bit
(string $string, [string $charset = null])
-
string
$string: The string to check.
-
string
$charset: The charset of the string. Defaults to US-ASCII. Since Horde 3.2.2.
Parses a list of email addresses into its parts.
Works with and without the imap extension being available and parses distribution lists as well.
array
parseAddressList
(string $address, [string $defserver = null], [boolean $validate = false])
-
string
$address: The address string.
-
string
$defserver: The default domain to append to mailboxes.
-
boolean
$validate: Whether to validate the address(es).
Encodes a line via quoted-printable encoding.
Wraps lines at 76 characters.
string
quotedPrintableEncode
(string $text, string $eol)
-
string
$text: The text to encode.
-
string
$eol: The EOL sequence to use.
Explodes an RFC 2822 string, ignoring a delimiter if preceded by a "\" character, or if the delimiter is inside single or double quotes.
array
rfc822Explode
(string $string, [string $delimiters = ','])
-
string
$string: The RFC 822 string.
-
string
$delimiters: A string containing valid delimiters. Defaults to ','.
Builds an RFC 822 compliant email address.
string
rfc822WriteAddress
(string $mailbox, [string $host = null], [string $personal = ''])
-
string
$mailbox: Mailbox name.
-
string
$host: Domain name of mailbox's host.
-
string
$personal: Personal name phrase.
If an email address has no personal information, get rid of any angle brackets (<>) around it.
string
trimEmailAddress
(string $address)
-
string
$address: The address to trim.
Returns the MIME type for the given input.
mixed
type
(mixed $input, [integer $format = null])
-
mixed
$input: Either the MIME code or type string.
-
integer
$format: If MIME_CODE, return code. If MIME_STRING, returns lowercase string.
Adds proper linebreaks to a header string.
RFC 2822 says headers SHOULD only be 78 characters a line, but also says that a header line MUST not be more than 998 characters.
string
wrapHeaders
(string $header, string $text, [string $eol = "\r\n"])
-
string
$header: The header name.
-
string
$text: The text of the header field.
-
string
$eol: The EOL string to use.