Para::Frame::Email::Address - Represents an email address
Objects of this class is a container for Mail::Address objects. It
stringifies to /as_string and uses /equals for eq
/ne
comparsions.
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
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.
$class->new( $string )
Simple constructor that only takes string and returns object
$a->broken
Returns true if the parsing failed
$a->error_message
Returns: the error message, if the email is broken, or from the latest validation.
$a->as_string
Same as /address
$a->original
Returns the original value given at creation
$a->user
Returns a string using Mail::Address/user
$a->address
Returns a string using Mail::Address/address
$a->host
Returns a string using Mail::Address/host
$a->format
Reimplements Mail::Address/format, since /name may have been subclassd.
$a->format_mime
As /format but mime-encodes non-ascii chars.
$a->format_human
Returns a human readable version of the object including the name if existing.
$a->name
Returns the name for the email address.
$a->phrase
Returns the phrase in the email address.
$a->comment
Returns the comment in the email address.
$a->desig
Gives a resonable designation of the object. Calls /format
$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 ...
$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.
Adds email
as an global tt param. Uses /parse.