.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Mail::Message::Field::Address 3pm" .TH Mail::Message::Field::Address 3pm "2014-08-24" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Mail::Message::Field::Address \- One e\-mail address .SH "INHERITANCE" .IX Header "INHERITANCE" .Vb 3 \& Mail::Message::Field::Address \& is a Mail::Identity \& is a User::Identity::Item .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $addr = Mail::Message::Field::Address\->new(...); \& \& my $ui = User::Identity\->new(...); \& my $addr = Mail::Message::Field::Address\->coerce($ui); \& \& my $mi = Mail::Identity\->new(...); \& my $addr = Mail::Message::Field::Address\->coerce($mi); \& \& print $addr\->address; \& print $addr\->fullName; # possibly unicode! \& print $addr\->domain; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Many header fields can contain e\-mail addresses. Each e\-mail address can be represented by an object of this class. These objects will handle interpretation and character set encoding and decoding for you. .PP Extends \*(L"\s-1DESCRIPTION\*(R"\s0 in Mail::Identity. .SH "OVERLOADED" .IX Header "OVERLOADED" .IP "overload: \fBboolean\fR" 4 .IX Item "overload: boolean" The object used as boolean will always return \f(CW\*(C`true\*(C'\fR .ie n .IP "overload: \fBstring \fB$comparison\fB\fR" 4 .el .IP "overload: \fBstring \f(CB$comparison\fB\fR" 4 .IX Item "overload: string $comparison" Two address objects are the same when their email addresses are the same. .IP "overload: \fBstringification\fR" 4 .IX Item "overload: stringification" When the object is used in string context, it will return the encoded representation of the e\-mail address, just like \fIstring()\fR does. .SH "METHODS" .IX Header "METHODS" Extends \*(L"\s-1METHODS\*(R"\s0 in Mail::Identity. .SS "Constructors" .IX Subsection "Constructors" Extends \*(L"Constructors\*(R" in Mail::Identity. .ie n .IP "$obj\->\fBcoerce\fR( , %options )" 4 .el .IP "\f(CW$obj\fR\->\fBcoerce\fR( , \f(CW%options\fR )" 4 .IX Item "$obj->coerce( , %options )" Try to coerce the \f(CW$object\fR into a \f(CW\*(C`Mail::Message::Field::Address\*(C'\fR. In case of a \s-1STRING,\s0 it is interpreted as an email address. .Sp The \f(CW%options\fR are passed to the object creation, and overrule the values found in the \f(CW$object\fR. The result may be \f(CW\*(C`undef\*(C'\fR or a newly created object. If the \f(CW$object\fR is already of the correct type, it is returned unmodified. .Sp The \f(CW$object\fR may currently be a Mail::Address, a Mail::Identity, or a User::Identity. In case of the latter, one of the user's addresses is chosen at random. .IP "Mail::Message::Field::Address\->\fBnew\fR( [\s-1NAME\s0], \s-1OPTIONS \s0)" 4 .IX Item "Mail::Message::Field::Address->new( [NAME], OPTIONS )" Inherited, see \*(L"Constructors\*(R" in Mail::Identity .ie n .IP "$obj\->\fBparse\fR(\s-1STRING\s0)" 4 .el .IP "\f(CW$obj\fR\->\fBparse\fR(\s-1STRING\s0)" 4 .IX Item "$obj->parse(STRING)" Parse the string for an address. You never know whether one or more addresses are specified on a line (often applications are wrong), therefore, the \s-1STRING\s0 is first parsed for as many addresses as possible and then the one is taken at random. .SS "Attributes" .IX Subsection "Attributes" Extends \*(L"Attributes\*(R" in Mail::Identity. .ie n .IP "$obj\->\fBaddress\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBaddress\fR()" 4 .IX Item "$obj->address()" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .ie n .IP "$obj\->\fBcharset\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBcharset\fR()" 4 .IX Item "$obj->charset()" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .ie n .IP "$obj\->\fBcomment\fR( [\s-1STRING\s0] )" 4 .el .IP "\f(CW$obj\fR\->\fBcomment\fR( [\s-1STRING\s0] )" 4 .IX Item "$obj->comment( [STRING] )" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .ie n .IP "$obj\->\fBdescription\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBdescription\fR()" 4 .IX Item "$obj->description()" Inherited, see \*(L"Attributes\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBdomain\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBdomain\fR()" 4 .IX Item "$obj->domain()" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .ie n .IP "$obj\->\fBlanguage\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBlanguage\fR()" 4 .IX Item "$obj->language()" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .ie n .IP "$obj\->\fBlocation\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBlocation\fR()" 4 .IX Item "$obj->location()" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .ie n .IP "$obj\->\fBname\fR( [\s-1NEWNAME\s0] )" 4 .el .IP "\f(CW$obj\fR\->\fBname\fR( [\s-1NEWNAME\s0] )" 4 .IX Item "$obj->name( [NEWNAME] )" Inherited, see \*(L"Attributes\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBorganization\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBorganization\fR()" 4 .IX Item "$obj->organization()" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .ie n .IP "$obj\->\fBphrase\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBphrase\fR()" 4 .IX Item "$obj->phrase()" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .ie n .IP "$obj\->\fBusername\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBusername\fR()" 4 .IX Item "$obj->username()" Inherited, see \*(L"Attributes\*(R" in Mail::Identity .SS "Collections" .IX Subsection "Collections" Extends \*(L"Collections\*(R" in Mail::Identity. .ie n .IP "$obj\->\fBadd\fR(\s-1COLLECTION, ROLE\s0)" 4 .el .IP "\f(CW$obj\fR\->\fBadd\fR(\s-1COLLECTION, ROLE\s0)" 4 .IX Item "$obj->add(COLLECTION, ROLE)" Inherited, see \*(L"Collections\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBaddCollection\fR(\s-1OBJECT\s0 | ([\s-1TYPE\s0], \s-1OPTIONS\s0))" 4 .el .IP "\f(CW$obj\fR\->\fBaddCollection\fR(\s-1OBJECT\s0 | ([\s-1TYPE\s0], \s-1OPTIONS\s0))" 4 .IX Item "$obj->addCollection(OBJECT | ([TYPE], OPTIONS))" Inherited, see \*(L"Collections\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBcollection\fR(\s-1NAME\s0)" 4 .el .IP "\f(CW$obj\fR\->\fBcollection\fR(\s-1NAME\s0)" 4 .IX Item "$obj->collection(NAME)" Inherited, see \*(L"Collections\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBfind\fR(\s-1COLLECTION, ROLE\s0)" 4 .el .IP "\f(CW$obj\fR\->\fBfind\fR(\s-1COLLECTION, ROLE\s0)" 4 .IX Item "$obj->find(COLLECTION, ROLE)" Inherited, see \*(L"Collections\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBparent\fR( [\s-1PARENT\s0] )" 4 .el .IP "\f(CW$obj\fR\->\fBparent\fR( [\s-1PARENT\s0] )" 4 .IX Item "$obj->parent( [PARENT] )" Inherited, see \*(L"Collections\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBremoveCollection\fR(OBJECT|NAME)" 4 .el .IP "\f(CW$obj\fR\->\fBremoveCollection\fR(OBJECT|NAME)" 4 .IX Item "$obj->removeCollection(OBJECT|NAME)" Inherited, see \*(L"Collections\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBtype\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBtype\fR()" 4 .IX Item "$obj->type()" .PD 0 .IP "Mail::Message::Field::Address\->\fBtype\fR()" 4 .IX Item "Mail::Message::Field::Address->type()" .PD Inherited, see \*(L"Collections\*(R" in User::Identity::Item .ie n .IP "$obj\->\fBuser\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBuser\fR()" 4 .IX Item "$obj->user()" Inherited, see \*(L"Collections\*(R" in User::Identity::Item .SS "Accessors" .IX Subsection "Accessors" .ie n .IP "$obj\->\fBencoding\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBencoding\fR()" 4 .IX Item "$obj->encoding()" Character-set encoding, like 'q' and 'b', to be used when non-ascii characters are to be transmitted. .SS "Access to the content" .IX Subsection "Access to the content" .ie n .IP "$obj\->\fBstring\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBstring\fR()" 4 .IX Item "$obj->string()" Returns an \s-1RFC\s0 compliant e\-mail address, which will have character set encoding if needed. The objects are also overloaded to call this method in string context. .Sp example: .Sp .Vb 2 \& print $address\->string; \& print $address; # via overloading .Ve .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .ie n .IP "Error: $object is not a collection." 4 .el .IP "Error: \f(CW$object\fR is not a collection." 4 .IX Item "Error: $object is not a collection." The first argument is an object, but not of a class which extends User::Identity::Collection. .ie n .IP "Error: Cannot coerce a $type into a Mail::Message::Field::Address" 4 .el .IP "Error: Cannot coerce a \f(CW$type\fR into a Mail::Message::Field::Address" 4 .IX Item "Error: Cannot coerce a $type into a Mail::Message::Field::Address" When addresses are specified to be included in header fields, they may be coerced into Mail::Message::Field::Address objects first. What you specify is not accepted as address specification. This may be an internal error. .ie n .IP "Error: Cannot load collection module for $type ($class)." 4 .el .IP "Error: Cannot load collection module for \f(CW$type\fR ($class)." 4 .IX Item "Error: Cannot load collection module for $type ($class)." Either the specified \f(CW$type\fR does not exist, or that module named \f(CW$class\fR returns compilation errors. If the type as specified in the warning is not the name of a package, you specified a nickname which was not defined. Maybe you forgot the 'require' the package which defines the nickname. .ie n .IP "Error: Creation of a collection via $class failed." 4 .el .IP "Error: Creation of a collection via \f(CW$class\fR failed." 4 .IX Item "Error: Creation of a collection via $class failed." The \f(CW$class\fR did compile, but it was not possible to create an object of that class using the options you specified. .IP "Error: Don't know what type of collection you want to add." 4 .IX Item "Error: Don't know what type of collection you want to add." If you add a collection, it must either by a collection object or a list of options which can be used to create a collection object. In the latter case, the type of collection must be specified. .ie n .IP "Warning: No collection $name" 4 .el .IP "Warning: No collection \f(CW$name\fR" 4 .IX Item "Warning: No collection $name" The collection with \f(CW$name\fR does not exist and can not be created. .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail-Box distribution version 2.117, built on August 24, 2014. Website: \fIhttp://perl.overmeer.net/mailbox/\fR .SH "LICENSE" .IX Header "LICENSE" Copyrights 2001\-2014 by [Mark Overmeer]. For other contributors see ChangeLog. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \fIhttp://www.perl.com/perl/misc/Artistic.html\fR