Mail/Part.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Mail
- Version
- $Id$
Package: Zend_Mail- Implements
- Children
- \Zend_Mail_Message
- \Zend_Mail_Part_File
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
int $_iterationPos = 1
current position of iterator
Default value1
Details- Type
- int
int $_messageNum = 0
message number for mail handler
Default value0
Details- Type
- int
array $_parts = array()
parts of multipart message
Default valuearray()
Details- Type
- array
string $_topLines = ''
toplines as fetched with headers
Default value''
Details- Type
- string
Methods
__construct(array $params) : void
Zend_Mail_Part supports different sources for content. The possible params are:
- handler a instance of Zend_Mail_Storage_Abstract 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
ParametersName | Type | Description |
---|
$params | array | full message with or without headers |
---|
Throws__get(string $name) : string
Getter for mail headers - name is matched in lowercase
This getter is short for Zend_Mail_Part::getHeader($name, 'string')
ParametersName | Type | Description |
---|
$name | string | header name |
---|
ReturnsType | Description |
---|
string | value of header |
ThrowsDetails- See
-
__isset( $name) : boolean
Isset magic method proxy to hasHeader
This method is short syntax for Zend_Mail_Part::hasHeader($name);
ParametersReturnsDetails- See
-
__toString() : string
magic method to get content of part
ReturnsType | Description |
---|
string | content |
countParts() : int
Count parts of a multipart part
ReturnsType | Description |
---|
int | number of sub-parts |
getHeader(string $name, string $format = null) : string | array
Get a header in specificed format
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).
ParametersName | Type | Description |
---|
$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' |
---|
ReturnsType | Description |
---|
string | array | value of header in wanted or internal format |
ThrowsgetHeaderField(string $name, string $wantedPart = 0, string $firstName = 0) : string | array
Get a specific field from a header like content type or all fields as 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.
ParametersName | Type | Description |
---|
$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 |
---|
ReturnsType | Description |
---|
string | array | wanted part or all parts as array($firstName => firstPart, partname => value) |
ThrowsgetPart(int $num) : \Zend_Mail_Part
Get part of multipart message
ParametersName | Type | Description |
---|
$num | int | number of part starting with 1 for first part |
---|
ReturnsThrows hasChildren() : bool
implements RecursiveIterator::hasChildren()
ReturnsType | Description |
---|
bool | current element has children/is multipart |
headerExists(string $name) : boolean
Check wheater the Mail part has a specific header.
ParametersName | Type | Description |
---|
$name | string | |
---|
Returns isMultipart() : bool
Check if part is a multipart message
ReturnsType | Description |
---|
bool | if part is multipart |
key() : string
implements Iterator::key()
ReturnsType | Description |
---|
string | key/number of current part |
setPartClass(string $class) : \Zend_Mail_Part
Set name pf class used to encapsulate message parts
ParametersName | Type | Description |
---|
$class | string | |
---|
Returns valid() : bool
implements Iterator::valid()
ReturnsType | Description |
---|
bool | check if there's a current element |