Methods

Add an address to the list

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

Parameters

$emailOrAddress

string\Zend\Mail\Address\AddressInterface

$name

nullstring

Exceptions

\Zend\Mail\Exception\InvalidArgumentException

Returns

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

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

Return count of addresses

count() : int

Returns

int

Return current item in iteration

current() : \Zend\Mail\Address

Delete an address from the list

delete(string $email) : bool

Parameters

$email

string

Returns

bool

Get an address by email

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

Parameters

$email

string

Returns

Does the email exist in this list?

has(string $email) : bool

Parameters

$email

string

Returns

bool

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

Rewind iterator

rewind() : mixed

see \Zend\Mail\addresses

Returns

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

Is the current item of iteration valid?

valid() : bool

Returns

bool

Create an address object

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

Parameters

$email

string

$name

stringnull

Returns

 Properties

 

List of Address objects we're managing

$addresses : array