category Zend
package Zend_Mail
subpackage Storage
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Getter for mail headers - name is matched in lowercase

__get(string $name) : string

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

see

Parameters

$name

string

header name

Exceptions

\Zend_Mail_Exception

Returns

stringvalue of header

magic method to get content of part

__toString() : string

Returns

stringcontent

Count parts of a multipart part

countParts() : integer

Returns

integernumber of sub-parts

Body of part

getContent() : string

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

Exceptions

\Zend_Mail_Exception

Returns

stringbody

Get a header in specificed format

getHeader(string $name, string $format = null) : string | array

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 Zend_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_Exception

Returns

stringarrayvalue 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 = 0, string $firstName = 0) : string | array

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

Throws a Zend_Mail_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_Exception, Zend_Mail_Exception

Returns

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

Get all headers

getHeaders() : array

The returned headers are as saved internally. All names are lowercased. The value is a string or an array if a header with the same name occurs more than once.

Returns

arrayheaders as array(name => value)

Get part of multipart message

getPart(integer $num) : \Zend_Mail_Part

Parameters

$num

integer

number of part starting with 1 for first part

Exceptions

\Zend_Mail_Exception

Returns

\Zend_Mail_Partwanted part

Return size of part

getSize() : integer

Returns

integersize

Check if part is a multipart message

isMultipart() : boolean

Returns

booleanif part is multipart