package Default

 Methods

Add an address to the list

add(string|\Zend\Mail\Address\AddressInterface $emailOrAddress, null|string $name = null) : \Zend\Mail\AddressList

Parameters

$emailOrAddress

string\Zend\Mail\Address\AddressInterface

$name

nullstring

Exceptions

\Zend\Mail\Exception\InvalidArgumentException

Returns

\Zend\Mail\AddressList

Add an address to the list from any valid string format, such as - "ZF Dev" <dev@zf.com> - dev@zf.com

addFromString(string $address) : \Zend\Mail\AddressList

Parameters

$address

string

Exceptions

\Zend\Mail\Exception\InvalidArgumentException

Returns

\Zend\Mail\AddressList

Add many addresses at once

addMany(array $addresses) : \Zend\Mail\AddressList

If an email key is provided, it will be used as the email, and the value as the name. Otherwise, the value is passed as the sole argument to add(), and, as such, can be either email strings or Address\AddressInterface objects.

Parameters

$addresses

array

Exceptions

\Zend\Mail\Exception\RuntimeException

Returns

\Zend\Mail\AddressList

Return count of addresses

count() : integer

Returns

integer

Return current item in iteration

current() : \Zend\Mail\Address

Returns

\Zend\Mail\Address

Delete an address from the list

delete(string $email) : boolean

Parameters

$email

string

Returns

boolean

Get an address by email

get(string $email) : boolean | \Zend\Mail\Address\AddressInterface

Parameters

$email

string

Returns

boolean\Zend\Mail\Address\AddressInterface

Does the email exist in this list?

has(string $email) : boolean

Parameters

$email

string

Returns

boolean

Return key of current item of iteration

key() : string

Returns

string

Merge another address list into this one

merge(\Zend\Mail\AddressList $addressList) : \Zend\Mail\AddressList

Parameters

$addressList

\Zend\Mail\AddressList

Returns

\Zend\Mail\AddressList

Move to next item

next() : mixed
see

Returns

mixedthe addresses value in the next place that's pointed to by the internal array pointer, or false if there are no more elements.

Rewind iterator

rewind() : mixed
see

Returns

mixedthe value of the first addresses element, or false if the addresses is empty.

Is the current item of iteration valid?

valid() : boolean

Returns

boolean

Create an address object

createAddress(string $email, string|null $name) : \Zend\Mail\Address

Parameters

$email

string

$name

stringnull

Returns

\Zend\Mail\Address

 Properties

 

List of Address objects we're managing

$addresses : array

Default

array()