category Zend
package Zend_Mail

 Methods

Add a "Bcc" address

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

Parameters

$emailOrAddressOrList

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

$name

stringnull

Returns

Add a "Cc" address

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

Parameters

$emailOrAddressOrList

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

$name

stringnull

Returns

Add a "From" address

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

Parameters

$emailOrAddressOrList

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

$name

stringnull

Returns

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) : \Zend\Mail\Message

Appends to the list.

Parameters

$emailOrAddressOrList

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

$name

nullstring

Returns

Add one or more addresses to the To recipients

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

Appends to the list.

Parameters

$emailOrAddressOrList

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

$name

nullstring

Returns

Retrieve list of BCC recipients

getBcc() : \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

Get the message encoding

getEncoding() : string

Returns

string

Retrieve list of From senders

getFrom() : \Zend\Mail\AddressList

Access headers collection

getHeaders() : \Zend\Mail\Headers

Lazy-loads if not already attached.

Returns

Access the address list of the Reply-To header

getReplyTo() : \Zend\Mail\AddressList

Retrieve the sender address, if any

getSender() : 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

Is the message valid?

isValid() : bool

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

Returns

bool

Set (overwrite) BCC addresses

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

Parameters

$emailOrAddressList

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

$name

stringnull

Returns

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

Set (overwrite) CC addresses

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

Parameters

$emailOrAddressList

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

$name

stringnull

Returns

Set the message encoding

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

Parameters

$encoding

string

Returns

Set (overwrite) From addresses

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

Parameters

$emailOrAddressList

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

$name

stringnull

Returns

Compose headers

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

Parameters

Returns

Overwrite the address list in the Reply-To recipients

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

Parameters

$emailOrAddressList

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

$name

nullstring

Returns

setSender

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

Parameters

$emailOrAddress

mixed

$name

mixed

Returns

Set the message subject header value

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

Parameters

$subject

string

Returns

Overwrite the address list in the To recipients

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

Parameters

$emailOrAddressList

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

$name

nullstring

Returns

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

Retrieve a header by name

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

If not found, instantiates one based on $headerClass.

Parameters

$headerName

string

$headerClass

string

Returns

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

 

Message encoding

$encoding : string

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

 

$headers

$headers : \Zend\Mail\Headers