METHODS

Constructors

$class->new( PHRASE, ADDRESS, [ COMMENT ] )

Create a new Mail::Address object which represents an address with the elements given. In a message these 3 elements would be seen like:

 PHRASE <ADDRESS> (COMMENT)
 ADDRESS (COMMENT)
» Example:
 Mail::Address->new("Perl5 Porters", "perl5-porters@africa.nicoh.com");
$obj->parse( LINE )

Parse the given line a return a list of extracted Mail::Address objects. The line would normally be one taken from a To,Cc or Bcc line in a message

» Example:
 my @addr = Mail::Address->parse($line);

Accessors

$obj->address

Return the address part of the object.

$obj->comment

Return the comment part of the object

$obj->format( [ADDRESSes] )

Return a string representing the address in a suitable form to be placed on a To, Cc, or Bcc line of a message. This method is called on the first ADDRESS to be used; other specified ADDRESSes will be appended, separated with commas.

$obj->phrase

Return the phrase part of the object.

Smart accessors

$obj->host

Return the address excluding the user id and '@'

$obj->name

Using the information contained within the object attempt to identify what the person or groups name is.

$obj->user

Return the address excluding the '@' and the mail domain