=head1 NAME Mail::Message::Field::Addresses - Fields with e-mail addresses =head1 INHERITANCE Mail::Message::Field::Addresses is a Mail::Message::Field::Structured is a Mail::Message::Field::Full is a Mail::Message::Field is a Mail::Reporter =head1 SYNOPSIS my $f = Mail::Message::Field->new(Cc => 'Mail::Box '); my $cc = Mail::Message::Field->new('Cc'); $cc->addAddress('Mail::Box '); $cc->addAddress ( phrase => 'Mail::Box' , email => 'mailbox@overmeer.net' , comment => 'Our mailing list' # deprecated by RFC ); mu $ma = Mail::Message::Field::Address->new(...); $cc->addAddress($ma); my $mi = Mail::Identity->new(...); $cc->addAddress($mi); my $g = Mail::Message::Field::AddrGroup->new(...); $cc->addGroup($g); =head1 DESCRIPTION All header fields which contain e-mail addresses only. Not all address fields have the same possibilities, but they are all parsed the same: you never know how broken the applications are which produce those messages. When you try to create constructs which are not allowed for a certain kind of field, you will be warned. =head1 OVERLOADED overload: B<""> =over 4 See L =back overload: B<+0> =over 4 See L =back overload: B<<=>> =over 4 See L =back overload: B =over 4 See L =back overload: B =over 4 See L =back overload: B =over 4 See L =back =head1 METHODS =head2 Constructors $obj-EB =over 4 See L =back Mail::Message::Field::Addresses-EB(FIELD, OPTIONS) =over 4 See L =back Mail::Message::Field::Addresses-EB =over 4 Option --Defined in --Default attributes Mail::Message::Field::Structured charset Mail::Message::Field::Full undef datum Mail::Message::Field::Structured undef encoding Mail::Message::Field::Full 'q' force Mail::Message::Field::Full false language Mail::Message::Field::Full undef log Mail::Reporter 'WARNINGS' trace Mail::Reporter 'WARNINGS' . attributes => ATTRS . charset => STRING . datum => STRING . encoding => 'q'|'Q'|'b'|'B' . force => BOOLEAN . language => STRING . log => LEVEL . trace => LEVEL =back =head2 The field $obj-EB Mail::Message::Field::Addresses-EB =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB([FILEHANDLE]) =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB([WRAP]) =over 4 See L =back $obj-EB =over 4 See L =back =head2 Access to the name $obj-EB =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB([STRING]) =over 4 See L =back =head2 Access to the body $obj-EB =over 4 See L =back $obj-EB(OPTIONS) =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB([BODY]) =over 4 See L =back $obj-EB([STRING]) Mail::Message::Field::Addresses-EB([STRING]) =over 4 See L =back $obj-EB([BODY, [WRAP]]) =over 4 See L =back =head2 Access to the content $obj-EB([ADDRESS], OPTIONS) =over 4 Add an ADDRESS to the field. The addresses are organized in groups. If no group is specified, the default group is taken to store the address in. If no ADDRESS is specified, the option must be sufficient to create a L from. See the OPTIONS of L. Option--Default group '' . group => STRING =back $obj-EB(...) =over 4 Attributes are not supported for address fields. =back $obj-EB(GROUP|OPTIONS) =over 4 Add a group of addresses to this field. A GROUP can be specified, which is a L object, or one is created for you using the OPTIONS. The group is returned. Option--Default name '' . name => STRING =back $obj-EB =over 4 Returns a list with all addresses defined in any group of addresses: all addresses which are specified on the line. The addresses are L objects. example: my @addr = $field->addresses; =back $obj-EB(OBJECT|(STRING, OPTIONS)|(NAME,VALUE,OPTIONS)) =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB([STRING]) =over 4 See L =back $obj-EB(STRING, OPTIONS) Mail::Message::Field::Addresses-EB(STRING, OPTIONS) =over 4 See L =back $obj-EB(STRING, OPTIONS) Mail::Message::Field::Addresses-EB(STRING, OPTIONS) =over 4 See L =back $obj-EB(NAME) =over 4 Returns the group of addresses with the specified NAME, or C if it does not exist. If NAME is C, then the default groep is returned. =back $obj-EB =over 4 Returns a list with all group names which are defined. =back $obj-EB =over 4 Returns all address groups which are defined in this field. Each element is a L object. =back $obj-EB =over 4 See L =back $obj-EB([TIME]) Mail::Message::Field::Addresses-EB([TIME]) =over 4 See L =back $obj-EB =over 4 See L =back =head2 Other methods $obj-EB(STRING) Mail::Message::Field::Addresses-EB(STRING) =over 4 See L =back =head2 Internals $obj-EB(LINE | (NAME,BODY|OBJECTS)) =over 4 See L =back $obj-EB(STRING, OPTIONS) Mail::Message::Field::Addresses-EB(STRING, OPTIONS) =over 4 See L =back $obj-EB([LENGTH]) =over 4 See L =back $obj-EB(STRING, OPTIONS) =over 4 See L =back $obj-EB(NAME, BODY, [MAXCHARS]) Mail::Message::Field::Addresses-EB(NAME, BODY, [MAXCHARS]) =over 4 See L =back $obj-EB([LENGTH]) =over 4 See L =back $obj-EB(STRING|ARRAY|OBJECTS) =over 4 See L =back $obj-EB(STRING) =over 4 See L =back =head2 Parsing $obj-EB(STRING, OPTIONS) =over 4 Try to destilate address information from the STRING. Returned are an address B and the left-over string. If no address was found, the first returned value is C. =back $obj-EB(STRING) Mail::Message::Field::Addresses-EB(STRING) =over 4 See L =back $obj-EB(STRING) =over 4 Try to get a valid domain representation from STRING. Returned are the domain string as found (or C) and the rest of the string. =back $obj-EB(STRING) =over 4 See L =back $obj-EB(STRING) Mail::Message::Field::Addresses-EB(STRING) =over 4 See L =back $obj-EB([VALUE]) =over 4 See L =back $obj-EB(STRING) =over 4 See L =back $obj-EB =over 4 See L =back =head2 Error handling $obj-EB =over 4 See L =back $obj-EB(OBJECT) =over 4 See L =back $obj-EB([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) Mail::Message::Field::Addresses-EB([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB([LEVEL [,STRINGS]]) Mail::Message::Field::Addresses-EB([LEVEL [,STRINGS]]) =over 4 See L =back $obj-EB(LEVEL) Mail::Message::Field::Addresses-EB(LEVEL) =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB =over 4 See L =back $obj-EB([LEVEL]) =over 4 See L =back $obj-EB([LEVEL]) =over 4 See L =back $obj-EB([LEVEL]) =over 4 See L =back $obj-EB =over 4 See L =back =head2 Cleanup $obj-EB =over 4 See L =back $obj-EB =over 4 See L =back =head1 DETAILS =head1 DIAGNOSTICS Warning: Field content is not numerical: $content =over 4 The numeric value of a field is requested (for instance the C or C fields should be numerical), however the data contains weird characters. =back Warning: Illegal character in charset '$charset' =over 4 The field is created with an utf8 string which only contains data from the specified character set. However, that character set can never be a valid name because it contains characters which are not permitted. =back Warning: Illegal character in field name $name =over 4 A new field is being created which does contain characters not permitted by the RFCs. Using this field in messages may break other e-mail clients or transfer agents, and therefore mutulate or extinguish your message. =back Warning: Illegal character in language '$lang' =over 4 The field is created with data which is specified to be in a certain language, however, the name of the language cannot be valid: it contains characters which are not permitted by the RFCs. =back Warning: Illegal encoding '$encoding', used 'q' =over 4 The RFCs only permit base64 (C or C) or quoted-printable (C or C) encoding. Other than these four options are illegal. =back Error: No attributes for address fields. =over 4 Is is not possible to add attributes to address fields: it is not permitted by the RFCs. =back Error: Package $package does not implement $method. =over 4 Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. =back =head1 SEE ALSO This module is part of Mail-Box distribution version 2.079, built on November 28, 2007. Website: F =head1 LICENSE Copyrights 2001-2007 by Mark Overmeer. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See F