package Default

 Methods

Add a "Bcc" address

addBcc(string|\Zend\Mail\Address|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressOrList, string|null $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddressOrList

string\Zend\Mail\Addressarray\Zend\Mail\AddressList\Traversable

$name

stringnull

Returns

\Zend\Mail\Message

Add a "Cc" address

addCc(string|\Zend\Mail\Address|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressOrList, string|null $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddressOrList

string\Zend\Mail\Addressarray\Zend\Mail\AddressList\Traversable

$name

stringnull

Returns

\Zend\Mail\Message

Add a "From" address

addFrom(string|\Zend\Mail\Address|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressOrList, string|null $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddressOrList

string\Zend\Mail\Addressarray\Zend\Mail\AddressList\Traversable

$name

stringnull

Returns

\Zend\Mail\Message

Add one or more addresses to the Reply-To recipients

addReplyTo(string|\Zend\Mail\Address\AddressInterface|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressOrList, null|string $name = null) : \Zend\Mail\Message

Appends to the list.

Parameters

$emailOrAddressOrList

string\Zend\Mail\Address\AddressInterfacearray\Zend\Mail\AddressList\Traversable

$name

nullstring

Returns

\Zend\Mail\Message

Add one or more addresses to the To recipients

addTo(string|\Zend\Mail\Address\AddressInterface|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressOrList, null|string $name = null) : \Zend\Mail\Message

Appends to the list.

Parameters

$emailOrAddressOrList

string\Zend\Mail\Address\AddressInterfacearray\Zend\Mail\AddressList\Traversable

$name

nullstring

Returns

\Zend\Mail\Message

Instantiate from raw message string

fromString(string $rawMessage) : \Zend\Mail\Message
Static
todo Restore body to Mime\Message

Parameters

$rawMessage

string

Returns

\Zend\Mail\Message

Retrieve list of BCC recipients

getBcc() : \Zend\Mail\AddressList

Returns

\Zend\Mail\AddressList

Return the currently set message body

getBody() : object

Returns

object

Get the string-serialized message body text

getBodyText() : string

Returns

string

Retrieve list of CC recipients

getCc() : \Zend\Mail\AddressList

Returns

\Zend\Mail\AddressList

Get the message encoding

getEncoding() : string

Returns

string

Retrieve list of From senders

getFrom() : \Zend\Mail\AddressList

Returns

\Zend\Mail\AddressList

Access headers collection

getHeaders() : \Zend\Mail\Headers

Lazy-loads if not already attached.

Returns

\Zend\Mail\Headers

Access the address list of the Reply-To header

getReplyTo() : \Zend\Mail\AddressList

Returns

\Zend\Mail\AddressList

Retrieve the sender address, if any

getSender() : null | \Zend\Mail\Address\AddressInterface

Returns

null\Zend\Mail\Address\AddressInterface

Get the message subject header value

getSubject() : null | string

Returns

nullstring

Access the address list of the To header

getTo() : \Zend\Mail\AddressList

Returns

\Zend\Mail\AddressList

Is the message valid?

isValid() : boolean

If we don't any From addresses, we're invalid, according to RFC2822.

Returns

boolean

Set (overwrite) BCC addresses

setBcc(string|\Zend\Mail\Address\AddressInterface|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressList, string|null $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddressList

string\Zend\Mail\Address\AddressInterfacearray\Zend\Mail\AddressList\Traversable

$name

stringnull

Returns

\Zend\Mail\Message

Set the message body

setBody(null|string|\Zend\Mime\Message|object $body) : \Zend\Mail\Message

Parameters

$body

nullstring\Zend\Mime\Messageobject

Exceptions

\Zend\Mail\Exception\InvalidArgumentException

Returns

\Zend\Mail\Message

Set (overwrite) CC addresses

setCc(string|\Zend\Mail\Address\AddressInterface|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressList, string|null $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddressList

string\Zend\Mail\Address\AddressInterfacearray\Zend\Mail\AddressList\Traversable

$name

stringnull

Returns

\Zend\Mail\Message

Set the message encoding

setEncoding(string $encoding) : \Zend\Mail\Message

Parameters

$encoding

string

Returns

\Zend\Mail\Message

Set (overwrite) From addresses

setFrom(string|\Zend\Mail\Address\AddressInterface|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressList, string|null $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddressList

string\Zend\Mail\Address\AddressInterfacearray\Zend\Mail\AddressList\Traversable

$name

stringnull

Returns

\Zend\Mail\Message

Compose headers

setHeaders(\Zend\Mail\Headers $headers) : \Zend\Mail\Message

Parameters

$headers

\Zend\Mail\Headers

Returns

\Zend\Mail\Message

Overwrite the address list in the Reply-To recipients

setReplyTo(string|\Zend\Mail\Address\AddressInterface|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressList, null|string $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddressList

string\Zend\Mail\Address\AddressInterfacearray\Zend\Mail\AddressList\Traversable

$name

nullstring

Returns

\Zend\Mail\Message

setSender

setSender(mixed $emailOrAddress, mixed $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddress

mixed

$name

mixed

Returns

\Zend\Mail\Message

Set the message subject header value

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

Parameters

$subject

string

Returns

\Zend\Mail\Message

Overwrite the address list in the To recipients

setTo(string|\Zend\Mail\Address\AddressInterface|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressList, null|string $name = null) : \Zend\Mail\Message

Parameters

$emailOrAddressList

string\Zend\Mail\Address\AddressInterfacearray\Zend\Mail\AddressList\Traversable

$name

nullstring

Returns

\Zend\Mail\Message

Serialize to string

toString() : string

Returns

string

Clear a header by name

clearHeaderByName(string $headerName) 

Parameters

$headerName

string

Retrieve the AddressList from a named header

getAddressListFromHeader(string $headerName, string $headerClass) : \Zend\Mail\AddressList

Used with To, From, Cc, Bcc, and ReplyTo headers. If the header does not exist, instantiates it.

Parameters

$headerName

string

$headerClass

string

Exceptions

\Zend\Mail\Exception\DomainException

Returns

\Zend\Mail\AddressList

Retrieve a header by name

getHeaderByName(string $headerName, string $headerClass) : \Zend\Mail\Header\HeaderInterface | \ArrayIterator

If not found, instantiates one based on $headerClass.

Parameters

$headerName

string

$headerClass

string

Returns

\Zend\Mail\Header\HeaderInterface\ArrayIteratorheader instance or collection of headers

Update an address list

updateAddressList(\Zend\Mail\AddressList $addressList, string|\Zend\Mail\Address\AddressInterface|array|\Zend\Mail\AddressList|\Traversable $emailOrAddressOrList, null|string $name, string $callingMethod) 

Proxied to this from addFrom, addTo, addCc, addBcc, and addReplyTo.

Parameters

$addressList

\Zend\Mail\AddressList

$emailOrAddressOrList

string\Zend\Mail\Address\AddressInterfacearray\Zend\Mail\AddressList\Traversable

$name

nullstring

$callingMethod

string

Exceptions

\Zend\Mail\Exception\InvalidArgumentException

 Properties

 

Content of the message

$body : string | object

Default

 

Message encoding

$encoding : string

Default

'ASCII'

Used to determine whether or not to encode headers; defaults to ASCII.

 

$headers

$headers : \Zend\Mail\Headers

Default