Class representing a MIME part.

package Default

 Methods

create a new Mime Part.

__construct(mixed $content = ''

The (unencoded) content of the Part as passed as a string or stream

Parameters

$content

mixed

String or Stream containing the content

Exceptions

\Zend\Mime\Exception\InvalidArgumentException

Get boundary

getBoundary() : string

Returns

string

Get charset

getCharset() : string

Returns

string

Get the Content of the current Mime Part in the given encoding.

getContent(string $EOL = \Zend\Mime\Mime::LINEEND) : string

Parameters

$EOL

string

Returns

string

Get description

getDescription() : string

Returns

string

Get disposition

getDisposition() : string

Returns

string

if this was created with a stream, return a filtered stream for reading the content. very useful for large file attachments.

getEncodedStream(string $EOL = \Zend\Mime\Mime::LINEEND) : resource

Parameters

$EOL

string

Exceptions

\Zend\Mime\Exception\RuntimeException if not a stream or unable to append filter

Returns

resource

Get encoding

getEncoding() : string

Returns

string

Get filename

getFileName() : string

Returns

string

Get Filters

getFilters() : array

Returns

array

Return the headers for this part as a string

getHeaders(string $EOL = \Zend\Mime\Mime::LINEEND) : String

Parameters

$EOL

string

Returns

String

Create and return the array of headers for this MIME part

getHeadersArray(string $EOL = \Zend\Mime\Mime::LINEEND) : array
access public

Parameters

$EOL

string

Returns

array

Get id

getId() : string

Returns

string

Get isStream

getIsStream() : boolean

Returns

boolean

Get language

getLanguage() : string

Returns

string

Get location

getLocation() : string

Returns

string

Get the RAW unencoded content from this part

getRawContent() : string

Returns

string

Get type

getType() : string

Returns

string

check if this part can be read as a stream.

isStream() : boolean

if true, getEncodedStream can be called, otherwise only getContent can be used to fetch the encoded content of the part

Returns

boolean

Set boundary

setBoundary(string $boundary) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$boundary

string

Returns

\Zend\Mime\Part

Set charset

setCharset($charset) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$charset

Returns

\Zend\Mime\Part

Set content

setContent(mixed $content) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$content

mixed

String or Stream containing the content

Exceptions

\Zend\Mime\Exception\InvalidArgumentException

Returns

\Zend\Mime\Part

Set description

setDescription(string $description) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$description

string

Returns

\Zend\Mime\Part

Set disposition

setDisposition(string $disposition) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$disposition

string

Returns

\Zend\Mime\Part

Set encoding

setEncoding(string $encoding = \Zend\Mime\Mime::ENCODING_8BIT) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$encoding

string

Returns

\Zend\Mime\Part

Set filename

setFileName(string $fileName) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$fileName

string

Returns

\Zend\Mime\Part

Set filters

setFilters(array $filters = array()) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$filters

array

Returns

\Zend\Mime\Part

Set id

setId(string $id) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$id

string

Returns

\Zend\Mime\Part

Set isStream

setIsStream(boolean $isStream = false) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$isStream

boolean

Returns

\Zend\Mime\Part

Set language

setLanguage(string $language) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$language

string

Returns

\Zend\Mime\Part

Set location

setLocation(string $location) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$location

string

Returns

\Zend\Mime\Part

Set type

setType(string $type = \Zend\Mime\Mime::TYPE_OCTETSTREAM) : \Zend\Mime\Part
fluent This method is part of a fluent interface and will return the same instance

Parameters

$type

string

Returns

\Zend\Mime\Part

 Properties

 

$boundary

$boundary 

Default

 

$charset

$charset 

Default

 

$description

$description 

Default

 

$disposition

$disposition 

Default

 

$encoding

$encoding 

Default

\Zend\Mime\Mime::ENCODING_8BIT
 

$filename

$filename 

Default

 

$id

$id 

Default

 

$language

$language 

Default

 

$location

$location 

Default

 

$type

$type 

Default

\Zend\Mime\Mime::TYPE_OCTETSTREAM
 

$content

$content 

Default

 

$filters

$filters 

Default

array()
 

$isStream

$isStream 

Default

false