\Horde_Mail_Rfc822_Address

Object representation of a RFC 822 e-mail address.

Summary

Methods
Properties
Constants
__toString()
writeAddress()
match()
__construct()
__set()
__get()
matchInsensitive()
matchDomain()
$comment
$mailbox
$host
$personal
$bare_address
$bare_address_idn
$eai
$encoded
$host_idn
$label
$personal_encoded
$valid
No constants found
_writeAddress()
$_host
$_personal
N/A
No private methods found
No private properties found
N/A

Properties

$comment

$comment : array

Comments associated with the personal phrase.

Type

array

$mailbox

$mailbox : string

Local-part of the address (UTF-8).

Type

string

$host

$host : string

Returns the host part (UTF-8).

Type

string

$personal

$personal : string

The personal part (UTF-8).

Type

string

$bare_address

$bare_address : string

The bare mailbox@host address.

Type

string

$bare_address_idn

$bare_address_idn : string

The bare mailbox@host address (IDN encoded). (@since 2.1.0)

Type

string

$eai

$eai : boolean

Returns true if the local (mailbox) address part requires EAI (UTF-8) support. (@since 2.5.0)

Type

boolean

$encoded

$encoded : string

The full MIME/IDN encoded address (UTF-8).

Type

string

$host_idn

$host_idn : string

Returns the IDN encoded host part.

Type

string

$label

$label : string

The shorthand label for this address.

Type

string

$personal_encoded

$personal_encoded : string

The MIME encoded personal part (UTF-8).

Type

string

$valid

$valid : boolean

Returns true if there is enough information in object to create a valid address.

Type

boolean

$_host

$_host : string

Hostname of the address.

Type

string

$_personal

$_personal : string

Personal part of the address.

Type

string

Methods

__toString()

__toString() : string

String representation of object.

Returns

string —

Returns the full e-mail address.

writeAddress()

writeAddress(mixed  $opts = array()) : string

Write an address given information in this part.

Parameters

mixed $opts

If boolean true, is equivalent to passing true for both 'encode' and 'idn'. If an array, these keys are supported:

  • comment: (boolean) If true, include comment(s) in output? @since 2.6.0 DEFAULT: false
  • encode: (mixed) MIME encode the personal/groupname parts? If boolean true, encodes in 'UTF-8'. If a string, encodes using this charset. DEFAULT: false
  • idn: (boolean) If true, encodes IDN domain names (RFC 3490). DEFAULT: false
  • noquote: (boolean) If true, don't quote personal part. [@since 2.4.0] DEFAULT: false

Returns

string —

The correctly escaped/quoted address.

match()

match(mixed  $ob) : boolean

Compare this object against other data.

Parameters

mixed $ob

Address data.

Returns

boolean —

True if the data reflects the same canonical address.

__construct()

__construct(string  $address = null) 

Constructor.

Parameters

string $address

If set, address is parsed and used as the object address. Address is not validated; first e-mail address parsed is used.

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__get()

__get(  $name) 

Parameters

$name

Throws

\Horde_Idna_Exception

matchInsensitive()

matchInsensitive(mixed  $ob) : boolean

Do a case-insensitive match on the address. Per RFC 822/2822/5322, although the host portion of an address is case-insensitive, the mailbox portion is platform dependent.

Parameters

mixed $ob

Address data.

Returns

boolean —

True if the data reflects the same case-insensitive address.

matchDomain()

matchDomain(string  $domain) : boolean

Do a case-insensitive match on the address for a given domain.

Matches as many parts of the subdomain in the address as is given in the input.

Parameters

string $domain

Domain to match.

Returns

boolean —

True if the address matches the given domain.

_writeAddress()

_writeAddress(array  $opts) : string

Class-specific implementation of writeAddress().

Parameters

array $opts

See writeAddress().

Returns

string —

The correctly escaped/quoted address.