Constants

BASE64

BASE64 = 'BASE64' : string

Encoding constants

QUOTED_PRINTABLE

QUOTED_PRINTABLE = 'QUOTED_PRINTABLE'

BINARY

BINARY = 'BINARY'

_8BIT

_8BIT = '_8BIT'

_7BIT

_7BIT = '_7BIT'

Properties

$content

$content : string

Message part content

Type

string

$encoding

$encoding : string

Message part encoding

Type

string

$headers

$headers : array

Headers

Type

array

$contentType

$contentType : string

Content type

Type

string

$charSet

$charSet : string

Character set

Type

string

$id

$id : string

Message or part ID

Type

string

$idHeader

$idHeader : string

Message or part ID header name

Type

string

$basename

$basename : string

File attachment basename

Type

string

$stream

$stream : string

File attachment original stream content

Type

string

$contentTypes

$contentTypes : array

Common content types for auto-detection

Type

array

Methods

__construct()

__construct(string  $file = null, string  $stream = null, array  $options = array()) 

Constructor

Instantiate the mail attachment object

Parameters

string $file
string $stream
array $options

['contentType', 'basename', 'encoding', 'chunk']

Throws

\Pop\Mail\Message\Exception

getContent()

getContent() : string

Get message part content

Returns

string

setContent()

setContent(string  $content) : \Pop\Mail\Message\AbstractPart

Set message part content

Parameters

string $content

Returns

\Pop\Mail\Message\AbstractPart

getEncoding()

getEncoding() : string

Get message part encoding

Returns

string

setEncoding()

setEncoding(string  $encoding) : \Pop\Mail\Message\AbstractPart

Set message part encoding

Parameters

string $encoding

Returns

\Pop\Mail\Message\AbstractPart

isBase64()

isBase64() : string

Check if encoding in base-64

Returns

string

getBody()

getBody() : string

Get body

Returns

string

render()

render() : string

Render

Returns

string

renderAsLines()

renderAsLines() : array

Render as an array of lines

Returns

array

addHeader()

addHeader(string  $header, string  $value) : \Pop\Mail\Message\AbstractMessage

Add message part header

Parameters

string $header
string $value

Returns

\Pop\Mail\Message\AbstractMessage

addHeaders()

addHeaders(array  $headers) : \Pop\Mail\Message\AbstractMessage

Add message part headers

Parameters

array $headers

Returns

\Pop\Mail\Message\AbstractMessage

hasHeader()

hasHeader(string  $header) : boolean

Determine if message part has header

Parameters

string $header

Returns

boolean

getHeader()

getHeader(string  $header) : string

Get message part header

Parameters

string $header

Returns

string

getHeaders()

getHeaders() : array

Get all message part headers

Returns

array

getContentType()

getContentType() : string

Get message part content type

Returns

string

getCharSet()

getCharSet() : string

Get message part character set

Returns

string

setContentType()

setContentType(string  $contentType) : \Pop\Mail\Message\AbstractMessage

Set message part content type

Parameters

string $contentType

Returns

\Pop\Mail\Message\AbstractMessage

setCharSet()

setCharSet(string  $charSet = null) : \Pop\Mail\Message\AbstractMessage

Set message part character set

Parameters

string $charSet

Returns

\Pop\Mail\Message\AbstractMessage

getHeaderAsString()

getHeaderAsString(string  $header) : string

Get header as string

Parameters

string $header

Returns

string

getHeadersAsString()

getHeadersAsString(array  $omitHeaders = array()) : string

Get all message headers as string

Parameters

array $omitHeaders

Returns

string

setIdHeader()

setIdHeader(string  $header) : \Pop\Mail\Message\AbstractMessage

Set the ID header name

Parameters

string $header

Returns

\Pop\Mail\Message\AbstractMessage

getIdHeader()

getIdHeader() : string

Get the ID

Returns

string

getId()

getId() : string

Get the ID

Returns

string

generateId()

generateId() : string

Generate a new ID

Returns

string

__toString()

__toString() : string

Render message to string

Returns

string

createFromFile()

createFromFile(string  $file, array  $options = array()) : self

Create attachment from file

Parameters

string $file
array $options

['contentType', 'basename', 'encoding', 'chunk']

Returns

self

createFromStream()

createFromStream(string  $stream, array  $options = array()) : self

Create attachment from stream

Parameters

string $stream
array $options

['contentType', 'basename', 'encoding', 'chunk']

Returns

self

getBasename()

getBasename() : string

Get attachment basename

Returns

string

getStream()

getStream() : string

Get attachment original stream content

Returns

string

getRandomId()

getRandomId() : string

Returns a random ID

Returns

string