Horde_Mail_Rfc822_Address
extends Horde_Mail_Rfc822_Object
in package
Object representation of a RFC 822 e-mail address.
Tags
Table of Contents
- $bare_address : string
- $bare_address_idn : string
- $comment : array<string|int, mixed>
- Comments associated with the personal phrase.
- $eai : bool
- $encoded : string
- $host : string
- $host_idn : string
- $label : string
- $mailbox : string
- Local-part of the address (UTF-8).
- $personal : string
- $personal_encoded : string
- $valid : bool
- $_host : string
- Hostname of the address.
- $_personal : string
- Personal part of the address.
- __construct() : mixed
- Constructor.
- __get() : mixed
- __set() : mixed
- __toString() : string
- String representation of object.
- match() : bool
- Compare this object against other data.
- matchDomain() : bool
- Do a case-insensitive match on the address for a given domain.
- matchInsensitive() : bool
- 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.
- writeAddress() : string
- Write an address given information in this part.
- _writeAddress() : string
- Class-specific implementation of writeAddress().
Properties
$bare_address read-only
public
string
$bare_address
The bare mailbox@host address.
$bare_address_idn read-only
public
string
$bare_address_idn
The bare mailbox@host address (IDN encoded). (@since 2.1.0)
$comment
Comments associated with the personal phrase.
public
array<string|int, mixed>
$comment
= array()
$eai read-only
public
bool
$eai
Returns true if the local (mailbox) address part requires EAI (UTF-8) support. (@since 2.5.0)
$encoded read-only
public
string
$encoded
The full MIME/IDN encoded address (UTF-8).
$host
public
string
$host
Returns the host part (UTF-8).
$host_idn read-only
public
string
$host_idn
Returns the IDN encoded host part.
$label read-only
public
string
$label
The shorthand label for this address.
$mailbox
Local-part of the address (UTF-8).
public
string
$mailbox
= \null
$personal
public
string
$personal
The personal part (UTF-8).
$personal_encoded read-only
public
string
$personal_encoded
The MIME encoded personal part (UTF-8).
$valid read-only
public
bool
$valid
Returns true if there is enough information in object to create a valid address.
$_host
Hostname of the address.
protected
string
$_host
= \null
$_personal
Personal part of the address.
protected
string
$_personal
= \null
Methods
__construct()
Constructor.
public
__construct([string $address = null ]) : mixed
Parameters
- $address : string = null
-
If set, address is parsed and used as the object address. Address is not validated; first e-mail address parsed is used.
Return values
mixed —__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Tags
Return values
mixed —__set()
public
__set(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
Return values
mixed —__toString()
String representation of object.
public
__toString() : string
Return values
string —Returns the full e-mail address.
match()
Compare this object against other data.
public
match(mixed $ob) : bool
Parameters
- $ob : mixed
-
Address data.
Return values
bool —True if the data reflects the same canonical address.
matchDomain()
Do a case-insensitive match on the address for a given domain.
public
matchDomain(string $domain) : bool
Matches as many parts of the subdomain in the address as is given in the input.
Parameters
- $domain : string
-
Domain to match.
Return values
bool —True if the address matches the given domain.
matchInsensitive()
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.
public
matchInsensitive(mixed $ob) : bool
Parameters
- $ob : mixed
-
Address data.
Return values
bool —True if the data reflects the same case-insensitive address.
writeAddress()
Write an address given information in this part.
public
writeAddress([mixed $opts = array() ]) : string
Parameters
- $opts : mixed = array()
-
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
Return values
string —The correctly escaped/quoted address.
_writeAddress()
Class-specific implementation of writeAddress().
protected
_writeAddress(mixed $opts) : string
Parameters
- $opts : mixed
-
See writeAddress().
Return values
string —The correctly escaped/quoted address.