Class Message

Summary

Fully Qualified Name: Zend\Mail\Message

Description

Methods

Name Description Defined By
addBcc() Add a "Bcc" address Message
addCc() Add a "Cc" address Message
addFrom() Add a "From" address Message
addReplyTo() Add one or more addresses to the Reply-To recipients Message
addTo() Add one or more addresses to the To recipients Message
fromString() Instantiate from raw message string Message
getBcc() Retrieve list of BCC recipients Message
getBody() Return the currently set message body Message
getBodyText() Get the string-serialized message body text Message
getCc() Retrieve list of CC recipients Message
getEncoding() Get the message encoding Message
getFrom() Retrieve list of From senders Message
getHeaders() Access headers collection Message
getReplyTo() Access the address list of the Reply-To header Message
getSender() Retrieve the sender address, if any Message
getSubject() Get the message subject header value Message
getTo() Access the address list of the To header Message
isValid() Is the message valid? Message
setBcc() Set (overwrite) BCC addresses Message
setBody() Set the message body Message
setCc() Set (overwrite) CC addresses Message
setEncoding() Set the message encoding Message
setFrom() Set (overwrite) From addresses Message
setHeaders() Compose headers Message
setReplyTo() Overwrite the address list in the Reply-To recipients Message
setSender() setSender Message
setSubject() Set the message subject header value Message
setTo() Overwrite the address list in the To recipients Message
toString() Serialize to string Message

Method Details

addBcc()

Add a "Bcc" address

Parameter Name Type Description
$emailOrAddressOrList string|\Address|array|\AddressList|\Traversable
$name string|null

Returns: \Message

addCc()

Add a "Cc" address

Parameter Name Type Description
$emailOrAddressOrList string|\Address|array|\AddressList|\Traversable
$name string|null

Returns: \Message

addFrom()

Add a "From" address

Parameter Name Type Description
$emailOrAddressOrList string|\Address|array|\AddressList|\Traversable
$name string|null

Returns: \Message

addReplyTo()

Add one or more addresses to the Reply-To recipients

Appends to the list.

Parameter Name Type Description
$emailOrAddressOrList string|\Address\AddressInterface|array|\AddressList|\Traversable
$name null|string

Returns: \Message

addTo()

Add one or more addresses to the To recipients

Appends to the list.

Parameter Name Type Description
$emailOrAddressOrList string|\Address\AddressInterface|array|\AddressList|\Traversable
$name null|string

Returns: \Message

fromString()

Instantiate from raw message string

Parameter Name Type Description
$rawMessage string

Returns: \Message

getBcc()

Retrieve list of BCC recipients

Returns: \AddressList

getBody()

Return the currently set message body

Returns: object|string|\Mime\Message

getBodyText()

Get the string-serialized message body text

Returns: string

getCc()

Retrieve list of CC recipients

Returns: \AddressList

getEncoding()

Get the message encoding

Returns: string

getFrom()

Retrieve list of From senders

Returns: \AddressList

getHeaders()

Access headers collection

Lazy-loads if not already attached.

Returns: \Headers

getReplyTo()

Access the address list of the Reply-To header

Returns: \AddressList

getSender()

Retrieve the sender address, if any

Returns: null|\Address\AddressInterface

getSubject()

Get the message subject header value

Returns: null|string

getTo()

Access the address list of the To header

Returns: \AddressList

isValid()

Is the message valid?

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

Returns: bool

setBcc()

Set (overwrite) BCC addresses

Parameter Name Type Description
$emailOrAddressList string|\Address\AddressInterface|array|\AddressList|\Traversable
$name string|null

Returns: \Message

setBody()

Set the message body

Parameter Name Type Description
$body null|string|\Zend\Mime\Message|object

Returns: \Message

setCc()

Set (overwrite) CC addresses

Parameter Name Type Description
$emailOrAddressList string|\Address\AddressInterface|array|\AddressList|\Traversable
$name string|null

Returns: \Message

setEncoding()

Set the message encoding

Parameter Name Type Description
$encoding string

Returns: \Message

setFrom()

Set (overwrite) From addresses

Parameter Name Type Description
$emailOrAddressList string|\Address\AddressInterface|array|\AddressList|\Traversable
$name string|null

Returns: \Message

setHeaders()

Compose headers

Parameter Name Type Description
$headers \Headers

Returns: \Message

setReplyTo()

Overwrite the address list in the Reply-To recipients

Parameter Name Type Description
$emailOrAddressList string|\Address\AddressInterface|array|\AddressList|\Traversable
$name null|string

Returns: \Message

setSender()

setSender

Parameter Name Type Description
$emailOrAddress mixed
$name mixed

Returns: \Message

setSubject()

Set the message subject header value

Parameter Name Type Description
$subject string

Returns: \Message

setTo()

Overwrite the address list in the To recipients

Parameter Name Type Description
$emailOrAddressList string|\Address\AddressInterface|array|\AddressList|\Traversable
$name null|string

Returns: \Message

toString()

Serialize to string

Returns: string

Top