NAME

Para::Frame::Email::Address - Represents an email address

DESCRIPTION

Objects of this class is a container for Mail::Address objects. It stringifies to /as_string and uses /equals for eq/ne comparsions.

parse

  Para::Frame::Email::Address->parse( $email_in )

  Para::Frame::Email::Address->parse( $address_obj )

This is the object constructor.

If $email_in already is an Para::Frame::Email::Address object; retuns it. Will rebless it if it's not of the given class.

Also takes Mail::Address objects as input.

Parses the address using Mail::Address/parse.

Checks that the domain name was given.

Returns the object.

Exceptions:

email - '$email_str_in' is not a correct email address

email - Give the whole email address, includning the \@\n'$email_str_in' is not correct

parse_tolerant

  Para::Frame::Email::Address->parse( $email_in )

  Para::Frame::Email::Address->parse( $address_obj )

Same as /parse, excepts that it returns an object even if the parsing failed. For representing existing, faulty email addresses.

new

  $class->new( $string )

Simple constructor that only takes string and returns object

broken

  $a->broken

Returns true if the parsing failed

error_message

  $a->error_message

Returns: the error message, if the email is broken, or from the latest validation.

as_string

  $a->as_string

Same as /address

original

  $a->original

Returns the original value given at creation

user

  $a->user

Returns a string using Mail::Address/user

address

  $a->address

Returns a string using Mail::Address/address

host

 $a->host

Returns a string using Mail::Address/host

format

 $a->format

Reimplements Mail::Address/format, since /name may have been subclassd.

format_mime

 $a->format_mime

As /format but mime-encodes non-ascii chars.

format_human

 $a->format_human

Returns a human readable version of the object including the name if existing.

name

  $a->name

Returns the name for the email address.

phrase

  $a->phrase

Returns the phrase in the email address.

comment

  $a->comment

Returns the comment in the email address.

desig

  $a->desig

Gives a resonable designation of the object. Calls /format

validate

 $a->validate

Checks that the address is valid. Checks that the domain exists and that it accepts email. If possible, checks that the email address exists at that domain.

Returns true if address was validated.

If the address was not validated, throws an exception.

Exceptions:

email - ... an explanation of what went wrong ...

equals

  $a->equals($a2)

Makes $a2 a atring if it is an object using /as_string.

Checks that the two strings are equal.

Returns true or false.

Global TT params

Adds email as an global tt param. Uses /parse.

on_configure

SEE ALSO

Para::Frame, Mail::Address