API Documentation

Mail/Part.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Mail
version
$Id: Part.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Mail_Part

Description

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.

Zend_Mail_Part

Implements
Zend_Mail_Part_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Mail
Properties
$_headers
$_content
$_topLines
$_parts
$_countParts
$_iterationPos
$_mail
$_messageNum
Methods
__construct
isMultipart
getContent
getSize
_cacheContent
getPart
countParts
getHeaders
getHeader
headerExists
getHeaderField
__get
__isset
__toString
hasChildren
getChildren
valid
next
key
current
rewind

Description

Properties

$_content

null|string $_content = ''

raw part body

Details

$_content
null|string
visibility
protected
default
final
false
static
false

$_countParts

null|int $_countParts = ''

count of parts of a multipart message

Details

$_countParts
null|int
visibility
protected
default
final
false
static
false

$_headers

null|array $_headers = ''

headers of part as array

Details

$_headers
null|array
visibility
protected
default
final
false
static
false

$_iterationPos

int $_iterationPos = '1'

current position of iterator

Details

$_iterationPos
int
visibility
protected
default
1
final
false
static
false

$_mail

null|Zend_Mail_Storage_Abstract $_mail = ''

mail handler, if late fetch is active

Details

$_mail
null|Zend_Mail_Storage_Abstract
visibility
protected
default
final
false
static
false

$_messageNum

int $_messageNum = '0'

message number for mail handler

Details

$_messageNum
int
visibility
protected
default
0
final
false
static
false

$_parts

array $_parts = 'array'

parts of multipart message

Details

$_parts
array
visibility
protected
default
array
final
false
static
false

$_topLines

string $_topLines = ''

toplines as fetched with headers

Details

$_topLines
string
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( array $params ) :

Public constructor

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

Arguments
$params
array
full message with or without headers
Details
visibility
public
final
false
static
false
throws

__get

__get( string $name ) : string

Getter for mail headers - name is matched in lowercase

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

Arguments
$name
string
header name
Output
string
value of header
Details
visibility
public
final
false
static
false
see
Zend_Mail_Part::getHeader()
throws

__isset

__isset(  $name ) : boolean

Isset magic method proxy to hasHeader

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

Arguments
$name
string
Output
boolean
Details
visibility
public
final
false
static
false
see
Zend_Mail_Part::hasHeader

__toString

__toString( ) : string

magic method to get content of part

Output
string
content
Details
visibility
public
final
false
static
false

_cacheContent

_cacheContent( ) : null

Cache content and split in parts if multipart

Output
null
Details
visibility
protected
final
false
static
false
throws

countParts

countParts( ) : int

Count parts of a multipart part

Output
int
number of sub-parts
Details
visibility
public
final
false
static
false

current

current( ) : Zend_Mail_Part

implements Iterator::current()

Output
Zend_Mail_Part
current part
Details
visibility
public
final
false
static
false

getChildren

getChildren( ) : Zend_Mail_Part

implements RecursiveIterator::getChildren()

Output
Zend_Mail_Part
same as self::current()
Details
visibility
public
final
false
static
false

getContent

getContent( ) : string

Body of part

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

Output
string
body
Details
visibility
public
final
false
static
false
throws

getHeader

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).

Arguments
$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'
Output
string|array
value of header in wanted or internal format
Details
visibility
public
final
false
static
false
throws

getHeaderField

getHeaderField( 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.

Arguments
$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
Output
string|array
wanted part or all parts as array($firstName => firstPart, partname => value)
Details
visibility
public
final
false
static
false
throws
Zend_Mail_Exception

getHeaders

getHeaders( ) : array

Get all headers

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.

Output
array
headers as array(name => value)
Details
visibility
public
final
false
static
false

getPart

getPart( int $num ) : Zend_Mail_Part

Get part of multipart message

Arguments
$num
int
number of part starting with 1 for first part
Output
Zend_Mail_Part
wanted part
Details
visibility
public
final
false
static
false
throws

getSize

getSize( ) : int

Return size of part

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

Output
int
size
Details
visibility
public
final
false
static
false

hasChildren

hasChildren( ) : bool

implements RecursiveIterator::hasChildren()

Output
bool
current element has children/is multipart
Details
visibility
public
final
false
static
false

headerExists

headerExists( string $name ) : boolean

Check wheater the Mail part has a specific header.

Arguments
$name
string
Output
boolean
Details
visibility
public
final
false
static
false

isMultipart

isMultipart( ) : bool

Check if part is a multipart message

Output
bool
if part is multipart
Details
visibility
public
final
false
static
false

key

key( ) : string

implements Iterator::key()

Output
string
key/number of current part
Details
visibility
public
final
false
static
false

next

next( ) : null

implements Iterator::next()

Output
null
Details
visibility
public
final
false
static
false

rewind

rewind( ) : null

implements Iterator::rewind()

Output
null
Details
visibility
public
final
false
static
false

valid

valid( ) : bool

implements Iterator::valid()

Output
bool
check if there's a current element
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.