\Horde_Mime_Headers_Addresses

This class represents address fields (RFC 5322).

Summary

Methods
Properties
Constants
__get()
__toString()
getHandles()
__construct()
setValue()
sendEncode()
isDefault()
getIterator()
__clone()
getAddressList()
doSendEncode()
$append_addr
$full_value
$value
$name
$value_single
No constants found
_setValue()
_sendEncode()
_sanityCheck()
$_name
$_values
N/A
No private methods found
No private properties found
N/A

Properties

$append_addr

$append_addr : boolean

By default, if more than 1 address header is found, the addresses are appended together into a single field. Set this value to false to ignore all but the *last* header.

Type

boolean

$full_value

$full_value : string

Full header value.

Type

string

$value

$value : string

Header value.

Type

string

$name

$name : string

Header name.

Type

string

$value_single

$value_single : string

The first header value.

Type

string

$_name

$_name : string

Header name (UTF-8, although limited to US-ASCII subset by RFCs).

Type

string

$_values

$_values : array

Header values.

Type

array

Methods

__get()

__get(  $name) 

Parameters

$name

__toString()

__toString() 

getHandles()

getHandles() : array

Return list of explicit header names handled by this driver.

Returns

array —

Header list.

__construct()

__construct(string  $name, mixed  $value) 

Constructor.

Parameters

string $name

Header name.

mixed $value

Header value(s).

setValue()

setValue(mixed  $value) 

Set the value of the header.

Parameters

mixed $value

Header value(s).

sendEncode()

sendEncode(array  $opts = array()) : array

Returns the encoded string value(s) needed when sending the header text to a RFC compliant mail submission server.

Parameters

array $opts

Additional options:

  • charset: (string) Charset to encode to. DEFAULT: UTF-8

Returns

array —

An array of string values.

isDefault()

isDefault() : boolean

If true, indicates the contents of the header is the default value.

Returns

boolean —

True if this header is the default value.

getIterator()

getIterator() 

__clone()

__clone() 

getAddressList()

getAddressList(boolean  $first = false) : mixed

Return the address list representation(s) for this header.

Parameters

boolean $first

If true, return only the first element rather than the entire list.

Returns

mixed —

A Horde_Mail_Rfc822_List object (if $first is true) or an array of those objects.

doSendEncode()

doSendEncode(array  $alist, array  $opts = array()) 

Do send encoding for addresses.

Needed as a static function because it is used by both single and multiple address headers.

Parameters

array $alist

An array of Horde_Mail_Rfc822_List objects.

array $opts

Additional options:

  • charset: (string) Encodes the headers using this charset. DEFAULT: UTF-8
  • defserver: (string) The default domain to append to mailboxes. DEFAULT: No default name.
  • idn: (boolean) Encode IDN domain names (RFC 3490) if true. DEFAULT: true

_setValue()

_setValue(  $value) 

TODO

Parameters

$value

Throws

\Horde_Mime_Exception

_sendEncode()

_sendEncode(array  $opts) 

Parameters

array $opts

See doSendEncode().

_sanityCheck()

_sanityCheck(string  $data) : string

Perform sanity checking on a header value.

Parameters

string $data

The header data.

Returns

string —

The cleaned header data.