Mail_RFC822

Mail_RFC822 -- Provides RFC822 compliant email address parsing

Description

This class performs email address checking according to the RFC822 specification. Note, that the class only checks for a proper format of the indicated email addresses. This means, it is not guaranted that the email adress itself is valid or exists.

Mail_RFC822::Mail_RFC822()

Mail_RFC822 Mail_RFC822 ([string $address = '', string [$defaultDomain = 'localhost'] [, boolean $nestGroups = false [, boolean $validate = false]]])

Description

Set up the object. The address must either be set here or when calling parseAddressList (). One or the other.

Parameter

Mail_RFC822::parseaddresslist()

array parseAddressList ([string $address = '', string [$defaultDomain = 'localhost'] [, boolean $nestGroups = false [, boolean $validate = false]]])

Description

Extract the given addresses into there parts.

Parameter

Example

This example instanciates an object, calls the validation method parseAddressList() and then prints the results:

<?php
$address = 'My group: "Richard Heyes" <richard@localhost>;, ted@phpguru.org (A comment)';
$rfc822  = new Mail_RFC822($address, 'phpguru.org', TRUE);

$addresses = $rfc822->parseAddressList();
print_r($addresses);
?>

This example produces the same results as above except that it calls the parseAddressList() method statically:

<?php
$address = 'My group: "Richard Heyes" <richard@localhost>;, ted@phpguru.org (A comment)';

$addresses = Mail_RFC822::parseAddressList($address, 'phpguru.org', TRUE);
print_r($addresses);
?>