Class Message

Description

The object that contains a message.

message is the object that contains messages. It is a recursive object in that through the $entities variable, it can contain more objects of type message. See documentation in mime.txt for a better description of how this works.

  • since: 1.3.0

Located in /class/mime/Message.class.php (line 27)


	
			
Variable Summary
string $body_part
string $decoded_body
array $entities
mixed $entity
string $entity_id
mixed $flags
boolean $is_answered
boolean $is_deleted
boolean $is_flagged
boolean $is_forwarded
boolean $is_mdnsent
boolean $is_seen
integer $length
object $mime_header
integer $offset
mixed $parent
string $parent_ent
string $type0
string $type1
Method Summary
static object Message parseBodyStructure (string $read,  &$i, [mixed $sub_msg = ''], integer $i)
static void parseStructure ( $read,  &$i, [ $sub_msg = ''])
void addEntity (object $msg)
void addRFC822Header (mixed $read)
void clean_up ()
entity findAlternativeEntity (array $alt_order)
array findDisplayEntity ([array $entity = array()], [array $alt_order = array('text/plain', 'text/html')], [boolean $strict = false])
array getAttachments ([array $exclude_id = array()], [array $result = array()])
mixed getEntity (string $ent)
string getFilename ()
string getMailbox ()
array handleRfc2231 (array $properties)
void initAttachment (string $type, string $name, string $location)
object AddressStructure parseAddress (string $read,  &$i, integer $i)
void parseDisposition (string $read,  &$i, integer $i, object Disposition 2)
object MessageHeader parseEnvelope (string $read,  &$i, object $hdr, integer $i)
object Language parseLanguage (string $read,  &$i, integer $i)
string parseLiteral (string $read,  &$i, integer $i)
string parseMessage (string $read, string $type0, string $type1)
integer parseParenthesis (string $read, integer $i)
array parseProperties (string $read,  &$i, integer $i)
string parseQuote (string $read,  &$i, integer $i)
void setBody (string $s)
void setEnt (string $ent)
void setEntIds ( &$msg, [mixed $init = false], [integer $i = 0], object $msg)
Variables
string $att_local_name = '' (line 131)

Local attachment filename location where the tempory attachment is stored. For use in delivery class.

string $body_part = '' (line 113)

Message text body

string $decoded_body = '' (line 78)
array $entities = array() (line 56)

Nested mime parts

mixed $entity (line 70)
string $entity_id = '' (line 61)

Message part id

mixed $flags = '' (line 41)
boolean $is_answered = 0 (line 88)

Message \answered status

boolean $is_deleted = 0 (line 98)

Message \deleted status

boolean $is_flagged = 0 (line 103)

Message \flagged status

boolean $is_forwarded = 0 (line 93)

Message forward status

boolean $is_mdnsent = 0 (line 108)

Message mdn status

boolean $is_seen = 0 (line 83)

Message \seen status

integer $length = 0 (line 125)

Message part length

for fetching body parts out of raw messages

object $mime_header = '' (line 37)

MessageHeader object

integer $offset = 0 (line 119)

Message part offset

for fetching body parts out of raw messages

mixed $parent = '' (line 74)
string $parent_ent (line 66)

Parent message part id

object $rfc822_header = '' (line 32)

rfc822header object

string $type0 = '' (line 46)

Media type

string $type1 = '' (line 51)

Media subtype

Methods
static method parseBodyStructure (line 345)
  • return: object
  • todo: document me
  • since: 1.4.0 (code was part of parseStructure() in 1.3.x)
static object Message parseBodyStructure (string $read,  &$i, [mixed $sub_msg = ''], integer $i)
  • string $read
  • integer $i
  • mixed $sub_msg
  • &$i
static method parseStructure (line 295)
static void parseStructure ( $read,  &$i, [ $sub_msg = ''])
  • $read
  • &$i
  • $sub_msg
addEntity (line 144)

Add nested message part

void addEntity (object $msg)
  • object $msg
addRFC822Header (line 197)

Add header object to message object.

WARNING: Unfinished code. Don't expect it to work in older sm versions.

  • todo: FIXME: rfc822header->parseHeader() does not return rfc822header object
void addRFC822Header (mixed $read)
  • mixed $read: array or string with message headers
clean_up (line 259)

Clean message object

void clean_up ()
findAlternativeEntity (line 1065)
entity findAlternativeEntity (array $alt_order)
  • array $alt_order
findDisplayEntity (line 986)
array findDisplayEntity ([array $entity = array()], [array $alt_order = array('text/plain', 'text/html')], [boolean $strict = false])
  • array $entity
  • array $alt_order
  • boolean $strict
findRelatedEntity (line 1091)
array findRelatedEntity ()
getAttachments (line 1111)
array getAttachments ([array $exclude_id = array()], [array $result = array()])
  • array $exclude_id
  • array $result
getEntity (line 206)
  • return: (object or string?)
mixed getEntity (string $ent)
  • string $ent
getFilename (line 153)

Get file name used for mime part

  • return: file name
  • since: 1.3.2
string getFilename ()
getMailbox (line 271)
string getMailbox ()
handleRfc2231 (line 556)

Joins RFC-2231 continuations, converts encoding to RFC-2047 style

array handleRfc2231 (array $properties)
  • array $properties
initAttachment (line 1155)

Add attachment to message object

void initAttachment (string $type, string $name, string $location)
  • string $type: attachment type
  • string $name: attachment name
  • string $location: path to attachment
parseAddress (line 804)
  • return: object
object AddressStructure parseAddress (string $read,  &$i, integer $i)
  • string $read
  • integer $i
  • &$i
parseDisposition (line 839)
void parseDisposition (string $read,  &$i, integer $i, object Disposition 2)
parseEnvelope (line 621)
  • return: object
object MessageHeader parseEnvelope (string $read,  &$i, object $hdr, integer $i)
  • string $read
  • integer $i
  • object $hdr: MessageHeader object
  • &$i
parseLanguage (line 864)
  • return: object or empty string
object Language parseLanguage (string $read,  &$i, integer $i)
  • string $read
  • integer $i
  • &$i
parseLiteral (line 711)
  • todo: document me
string parseLiteral (string $read,  &$i, integer $i)
  • string $read
  • integer $i
  • &$i
parseMessage (line 913)

Function to fill the message structure in case the

bodystructure is not available NOT FINISHED YET

  • return: (only when type0 is not message or multipart)
string parseMessage (string $read, string $type0, string $type1)
  • string $read
  • string $type0: message part type
  • string $type1: message part subtype
parseParenthesis (line 892)

Parse message text enclosed in parenthesis

integer parseParenthesis (string $read, integer $i)
  • string $read
  • integer $i
parseProperties (line 526)
array parseProperties (string $read,  &$i, integer $i)
  • string $read
  • integer $i
  • &$i
parseQuote (line 747)

function parseQuote

This extract the string value from a quoted string. After the end-quote character is found it returns the string. The offset $i when calling this function points to the first double quote. At the end it points to The ending quote. This function takes care of escaped double quotes. "some \"string\"" ^ ^ initial $i end position $i

  • return: string inbetween the double quotes
  • author: Marc Groot Koerkamp
string parseQuote (string $read,  &$i, integer $i)
  • string $read
  • integer $i: offset in $read
  • &$i
purgeAttachments (line 1179)

Delete all attachments from this object from disk.

  • since: 1.5.1
void purgeAttachments ()
setBody (line 252)

Set message body

void setBody (string $s)
  • string $s: message body
setEnt (line 136)
void setEnt (string $ent)
  • string $ent: entity id
setEntIds (line 308)
  • todo: document me
  • since: 1.4.0
void setEntIds ( &$msg, [mixed $init = false], [integer $i = 0], object $msg)
  • object $msg
  • mixed $init
  • integer $i
  • &$msg

Documentation generated on Mon, 13 Jan 2020 04:23:04 +0100 by phpDocumentor 1.4.3