Constants

CRLF

CRLF

Message newline constant

Properties

$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

$parts

$parts : array

Message parts

Type

array

$addresses

$addresses : array

Message addresses

Type

array

$boundary

$boundary : string

Message boundary

Type

string

Methods

__construct()

__construct(string  $subject) 

Constructor

Instantiate the message object

Parameters

string $subject

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) : \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  $omit = array()) : string

Get all message headers as string

Parameters

array $omit

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

getBody()

getBody() : string

Get message body

Returns

string

render()

render() : string

Render message

Returns

string

renderAsLines()

renderAsLines() : array

Render as an array of lines

Returns

array

__toString()

__toString() : string

Render message to string

Returns

string

load()

load(string  $message) : \Pop\Mail\Message

Load a message from a string source or file on disk

Parameters

string $message

Throws

\Pop\Mail\Exception

Returns

\Pop\Mail\Message

setSubject()

setSubject(string  $subject) : \Pop\Mail\Message

Set Subject

Parameters

string $subject

Returns

\Pop\Mail\Message

setTo()

setTo(string  $to) : \Pop\Mail\Message

Set To

Parameters

string $to

Returns

\Pop\Mail\Message

setCc()

setCc(string  $cc) : \Pop\Mail\Message

Set CC

Parameters

string $cc

Returns

\Pop\Mail\Message

setBcc()

setBcc(string  $bcc) : \Pop\Mail\Message

Set BCC

Parameters

string $bcc

Returns

\Pop\Mail\Message

setFrom()

setFrom(string  $from) : \Pop\Mail\Message

Set From

Parameters

string $from

Returns

\Pop\Mail\Message

setReplyTo()

setReplyTo(string  $replyTo) : \Pop\Mail\Message

Set Reply-To

Parameters

string $replyTo

Returns

\Pop\Mail\Message

setSender()

setSender(mixed  $sender) : \Pop\Mail\Message

Set Sender

Parameters

mixed $sender

Returns

\Pop\Mail\Message

setReturnPath()

setReturnPath(mixed  $returnPath) : \Pop\Mail\Message

Set Return-Path

Parameters

mixed $returnPath

Returns

\Pop\Mail\Message

setBody()

setBody(mixed  $body) : \Pop\Mail\Message

Set body

Parameters

mixed $body

Returns

\Pop\Mail\Message

addText()

addText(mixed  $text) : \Pop\Mail\Message

Add text message part

Parameters

mixed $text

Returns

\Pop\Mail\Message

addHtml()

addHtml(mixed  $html) : \Pop\Mail\Message

Add HTML message part

Parameters

mixed $html

Returns

\Pop\Mail\Message

attachFile()

attachFile(mixed  $file) : \Pop\Mail\Message

Attach file message part

Parameters

mixed $file

Returns

\Pop\Mail\Message

removeHeader()

removeHeader(string  $header) : \Pop\Mail\Message

Remove header

Parameters

string $header

Returns

\Pop\Mail\Message

getSubject()

getSubject() : string

Get subject

Returns

string

getTo()

getTo() : array

Get To

Returns

array

getCc()

getCc() : array

Get CC

Returns

array

getBcc()

getBcc() : array

Get BCC

Returns

array

getFrom()

getFrom() : array

Get From

Returns

array

getReplyTo()

getReplyTo() : array

Get Reply-To

Returns

array

getSender()

getSender() : array

Get Sender

Returns

array

getReturnPath()

getReturnPath() : array

Get Return-Path

Returns

array

getBoundary()

getBoundary() : string

Get message MIME boundary

Returns

string

getParts()

getParts() : array

Get message parts

Returns

array

setBoundary()

setBoundary(string  $boundary) : \Pop\Mail\Message

Set message MIME boundary

Parameters

string $boundary

Returns

\Pop\Mail\Message

generateBoundary()

generateBoundary() : \Pop\Mail\Message

Generate message MIME boundary

Returns

\Pop\Mail\Message

save()

save(string  $to) : void

Save message to file on disk

Parameters

string $to

parse()

parse(string  $stream) : \Pop\Mail\Message

Parse message from string

Parameters

string $stream

Throws

\Pop\Mail\Exception

Returns

\Pop\Mail\Message

parseMessageParts()

parseMessageParts(array  $parts) : array

Parse message parts from string

Parameters

array $parts

Throws

\Pop\Mail\Exception

Returns

array

__clone()

__clone() : void

Perform a "deep" clone of a message object

getRandomId()

getRandomId() : string

Returns a random ID

Returns

string

parseAddresses()

parseAddresses(mixed  $addresses, boolean  $asArray = false) : string

Parse addresses

Parameters

mixed $addresses
boolean $asArray

Returns

string

validateContentType()

validateContentType() : void

Validate content type based on message parts added to the message

parseNameAndEmail()

parseNameAndEmail(string  $address) : array

Parse a name and email from an address string

Parameters

string $address

Returns

array