Decode a mime part
string
decode
(string $input, [string $encoding = '7bit'])
-
string
$input: Input string
-
string
$encoding: Part encoding
Split an address list into a structured array list
array
decode_address_list
(string $input, [int $max = null], [boolean $decode = true], [string $fallback = null], [boolean $addronly = false])
-
string
$input: Input string
-
int
$max: List only this number of addresses
-
boolean
$decode: Decode address strings
-
string
$fallback: Fallback charset if none specified
-
boolean
$addronly: Return flat array with e-mail addresses only
Decode a message header value
string
decode_header
(string $input, [string $fallback = null])
-
string
$input: Header value
-
string
$fallback: Fallback charset if none specified
Decode a mime-encoded string to internal charset
string
decode_mime_string
(string $input, [string $fallback = null])
-
string
$input: Header value
-
string
$fallback: Fallback charset if none specified
Explodes header (e.g. address-list) string into array of strings using specified separator characters with proper handling of quoted-strings and comments (RFC2822)
array
explode_header_string
(string $separator, string $str, [bool $remove_comments = false])
-
string
$separator: String containing separator characters
-
string
$str: Header string
-
bool
$remove_comments: Enable to remove comments
A method to guess the mime_type of an attachment.
string
file_content_type
(string $path, string $name, [string $failover = 'application/octet-stream'], [boolean $is_stream = false], [boolean $skip_suffix = false])
-
string
$path: Path to the file or file contents
-
string
$name: File name (with suffix)
-
string
$failover: Mime type supplied for failover
-
boolean
$is_stream: Set to True if $path contains file contents
-
boolean
$skip_suffix: Set to True if the config/mimetypes.php mappig should be ignored
Wrap the given text to comply with RFC 2646
string
format_flowed
(string $text, [int $length = 72], [string $charset = null])
-
string
$text: Text to wrap
-
int
$length: Length
-
string
$charset: Character encoding of $text
Returns message/object character set name
string
get_charset
()
Get mimetype => file extension mapping
array
get_mime_extensions
([string $mimetype = null])
-
string
$mimetype: Mime-Type to get extensions for
Detect image type of the given binary data by checking magic numbers.
string
image_content_type
(string $data)
-
string
$data: Binary file content
Split RFC822 header string into an associative array
void
parse_headers
( $headers)
Parse the given raw message source and return a structure of rcube_message_part objects.
It makes use of the PEAR:Mail_mimeDecode library
-
string
$raw_body: The message source
Interpret a format=flowed message body according to RFC 2646
string
unfold_flowed
(string $text)
-
string
$text: Raw body formatted as flowed text
Improved wordwrap function with multibyte support.
The code is based on Zend_Text_MultiByte::wordWrap().
string
wordwrap
(string $string, [int $width = 75], [string $break = "\n"], [bool $cut = false], [string $charset = null], [bool $wrap_quoted = true])
-
string
$string: Text to wrap
-
int
$width: Line width
-
string
$break: Line separator
-
bool
$cut: Enable to cut word
-
string
$charset: Charset of $string
-
bool
$wrap_quoted: When enabled quoted lines will not be wrapped
Object constructor.
rcube_mime
__construct
([ $default_charset = null])