category Zend
package Zend_Mail
subpackage Storage

 Methods

Public constructor

__construct(array $params) 

Part supports different sources for content. The possible params are: - handler an instance of AbstractStorage for late fetch - id number of message for handler - raw raw content with header and body as string - headers headers as array (name => value) or string, if a content part is found it's used as toplines - noToplines ignore content found after headers in param 'headers' - content content as string - strict strictly parse raw content

Parameters

$params

array

full message with or without headers

Exceptions

\Zend\Mail\Storage\Exception\InvalidArgumentException

Getter for mail headers - name is matched in lowercase

__get(string $name) : string

This getter is short for Part::getHeader($name, 'string')

see \Zend\Mail\Storage\Part::getHeader()

Parameters

$name

string

header name

Exceptions

\Zend\Mail\Storage\Exception\ExceptionInterface

Returns

stringvalue of header

Isset magic method proxy to hasHeader

__isset($name) : bool

This method is short syntax for Part::hasHeader($name);

see \Zend\Mail\Storage\Part::hasHeader

Parameters

$name

string

Returns

bool

magic method to get content of part

__toString() : string

Returns

stringcontent

Count parts of a multipart part

countParts() : int

Returns

intnumber of sub-parts

implements Iterator::current()

current() : \Zend\Mail\Storage\Part

Returns

implements RecursiveIterator::getChildren()

getChildren() : \Zend\Mail\Storage\Part

Returns

\Zend\Mail\Storage\Partsame as self::current()

Body of part

getContent() : string

If part is multipart the raw content of this part with all sub parts is returned

Exceptions

\Zend\Mail\Storage\Exception\RuntimeException

Returns

stringbody

Get a header in specified format

getHeader(string $name, string $format) : string | array | \Zend\Mail\Header\HeaderInterface | \ArrayIterator

Internally headers that occur more than once are saved as array, all other as string. If $format is set to string implode is used to concat the values (with Mime::LINEEND as delim).

Parameters

$name

string

name of header, matches case-insensitive, but camel-case is replaced with dashes

$format

string

change type of return value to 'string' or 'array'

Exceptions

\Zend\Mail\Storage\Exception\InvalidArgumentException

Returns

stringarray\Zend\Mail\Header\HeaderInterface\ArrayIteratorvalue of header in wanted or internal format

Get a specific field from a header like content type or all fields as array

getHeaderField(string $name, string $wantedPart, string $firstName) : string | array

If the header occurs more than once, only the value from the first header is returned.

Throws an Exception if the requested header does not exist. If the specific header field does not exist, returns null.

Parameters

$name

string

name of header, like in getHeader()

$wantedPart

string

the wanted part, default is first, if null an array with all parts is returned

$firstName

string

key name for the first part

Exceptions

\Zend\Mime\Exception\RuntimeException

Returns

stringarraywanted part or all parts as array($firstName => firstPart, partname => value)

Access headers collection

getHeaders() : \Zend\Mail\Headers

Lazy-loads if not already attached.

Returns

Get part of multipart message

getPart(int $num) : \Zend\Mail\Storage\Part

Parameters

$num

int

number of part starting with 1 for first part

Exceptions

\Zend\Mail\Storage\Exception\RuntimeException

Returns

Return size of part

getSize() : int

Quite simple implemented currently (not decoding). Handle with care.

Returns

intsize

implements RecursiveIterator::hasChildren()

hasChildren() : bool

Returns

boolcurrent element has children/is multipart

Check if part is a multipart message

isMultipart() : bool

Returns

boolif part is multipart

implements Iterator::key()

key() : string

Returns

stringkey/number of current part

implements Iterator::rewind()

rewind() 

implements Iterator::valid()

valid() : bool

Returns

boolcheck if there's a current element

Cache content and split in parts if multipart

_cacheContent() : null

 Properties

 

raw part body

$content : null | string

 

count of parts of a multipart message

$countParts : null | int

 

Headers of the part

$headers : \Zend\Mail\Headers | null

 

current position of iterator

$iterationPos : int

 

mail handler, if late fetch is active

$mail : null | \Zend\Mail\Storage\AbstractStorage

 

message number for mail handler

$messageNum : int

 

parts of multipart message

$parts : array

 

toplines as fetched with headers

$topLines : string