rcube_message

Logical representation of a mail message with all its data and related functions

package

Framework

subpackage

Storage

author

Thomas Bruederli

Methods

__construct

__construct(string $uid, string $folder = null) 

Provide a uid, and parse message structure.

see self::$app,

self::$storage, self::$opt, self::$parts

Arguments

$uid

string

The message UID.

$folder

string

Folder name

Return a (decoded) message header

get_header(string $name, $raw = false) : string

Arguments

$name

string

Header name

$raw

Response

string

Header value

Set is_safe var and session data

set_safe(bool $safe = true) 

Arguments

$safe

bool

enable/disable

Compose a valid URL for getting a message part

get_part_url(string $mime_id, mixed $embed = false) : string

Arguments

$mime_id

string

Part MIME-ID

$embed

mixed

Mimetype class for parts to be embedded

Response

string

URL or false if part does not exist

Get content of a specific part of this message

get_part_content(string $mime_id, resource $fp = null, boolean $skip_charset_conv = false, int $max_bytes, boolean $formatted = true) : string

Arguments

$mime_id

string

Part MIME-ID

$fp

resource

File pointer to save the message part

$skip_charset_conv

boolean

Disables charset conversion

$max_bytes

int

Only read this number of bytes

$formatted

boolean

Enables formatting of text/* parts bodies

Response

string

Part content

Determine if the message contains a HTML part. This must to be a real part not an attachment (or its part)

has_html_part(bool $enriched = false) : bool

Arguments

$enriched

bool

Enables checking for text/enriched parts too

Response

bool

True if a HTML is available, False if not

Determine if the message contains a text/plain part. This must to be a real part not an attachment (or its part)

has_text_part() : bool

Response

bool

True if a plain text part is available, False if not

Return the first HTML part of this message

first_html_part() : string

Response

string

HTML message part content

Return the first text part of this message

first_text_part(\rcube_message_part &$part = null) : string

Arguments

$part

\rcube_message_part

Reference to the part if found

Response

string

Plain text message/part content

Checks if part of the message is an attachment (or part of it)

is_attachment(\rcube_message_part $part) : bool

Arguments

$part

\rcube_message_part

Message part

Response

bool

True if the part is an attachment part

Read the message structure returend by the IMAP server and build flat lists of content parts and attachments

parse_structure(\rcube_message_part $structure, bool $recursive = false) 

Arguments

$structure

\rcube_message_part

Message structure node

$recursive

bool

True when called recursively

Fill aflat array with references to all parts, indexed by part numbers

get_mime_numbers(\rcube_message_part &$part) 

Arguments

$part

\rcube_message_part

Message body structure

Decode a Microsoft Outlook TNEF part (winmail.dat)

tnef_decode(\rcube_message_part &$part) : array

Arguments

$part

\rcube_message_part

Message part to decode

Response

array

Parse message body for UUencoded attachments bodies

uu_decode(\rcube_message_part &$part) : array

Arguments

$part

\rcube_message_part

Message part to decode

Response

array

Deprecated methods (to be removed)

unfold_flowed($text) 
static

Arguments

$text

format_flowed

format_flowed($text, $length = 72) 
static

Arguments

$text

$length

Properties

Instace of framework class.

app : \rcube
var

Type(s)

\rcube

Instance of storage class

storage : \rcube_storage
var

Type(s)

\rcube_storage

Instance of mime class

mime : \rcube_mime
var

Type(s)

\rcube_mime

opt

opt : 

parse_alternative

parse_alternative : 

uid

uid : 

folder

folder : 

headers

headers : 

parts

parts : 

mime_parts

mime_parts : 

inline_parts

inline_parts : 

attachments

attachments : 

subject

subject : 

sender

sender : 

is_safe

is_safe :