1Mail::Field::AddrList(3U)ser Contributed Perl DocumentatiMoanil::Field::AddrList(3)
2
3
4
6 Mail::Field::AddrList - object representation of e-mail address lists
7
9 Mail::Field::AddrList
10 is a Mail::Field
11
13 use Mail::Field::AddrList;
14
15 $to = Mail::Field->new('To');
16 $from = Mail::Field->new('From', 'poe@daimi.aau.dk (Peter Orbaek)');
17
18 $from->create('foo@bar.com' => 'Mr. Foo', poe => 'Peter');
19 $from->parse('foo@bar.com (Mr Foo), Peter Orbaek <poe>');
20
21 # make a RFC822 header string
22 print $from->stringify(),"\n";
23
24 # extract e-mail addresses and names
25 @addresses = $from->addresses(); # strings
26 @names = $from->names(); # strings
27 @addr = $from->addr_list(); # Mail::Address objects (v2.00)
28
29 # adjoin a new address to the list
30 $from->set_address('foo@bar.com', 'Mr. Foo');
31
33 Defines parsing and formatting of address field, for the following
34 fields: "To", "From", "Cc", "Reply-To", and "Sender".
35
36 All the normally used features of the address field specification of
37 RFC2822 are implemented, but some complex (and therefore hardly ever
38 used) constructs will not be understood. Use
39 Mail::Message::Field::Full in MailBox if you need full RFC compliance.
40
41 Extends "DESCRIPTION" in Mail::Field.
42
44 Extends "METHODS" in Mail::Field.
45
46 Constructors
47 Extends "Constructors" in Mail::Field.
48
49 Mail::Field::AddrList->combine($fields)
50 Inherited, see "Constructors" in Mail::Field
51
52 Mail::Field::AddrList->extract( $tag, $head [, $index ] )
53 Inherited, see "Constructors" in Mail::Field
54
55 Mail::Field::AddrList->new( $tag [, STRING | %options] )
56 Inherited, see "Constructors" in Mail::Field
57
58 "Fake" constructors
59 Extends ""Fake" constructors" in Mail::Field.
60
61 $obj->create(%options)
62 Inherited, see ""Fake" constructors" in Mail::Field
63
64 $obj->parse()
65 Inherited, see ""Fake" constructors" in Mail::Field
66
67 Accessors
68 Extends "Accessors" in Mail::Field.
69
70 $obj->set(%options)
71 Inherited, see "Accessors" in Mail::Field
72
73 $obj->stringify()
74 Inherited, see "Accessors" in Mail::Field
75
76 $obj->tag()
77 Mail::Field::AddrList->tag()
78 Inherited, see "Accessors" in Mail::Field
79
80 Smart accessors
81 Extends "Smart accessors" in Mail::Field.
82
83 $obj->addr_list()
84 Returns the collected Mail::Address objects.
85
86 $obj->addresses()
87 Returns a list if email addresses, found in the field content.
88
89 $obj->names()
90 Returns a list of nicely formatted named, for each of the addresses
91 found in the content.
92
93 $obj->set_address($email, $name)
94 Add/replace an $email address to the field.
95
96 $obj->text( [STRING] )
97 Inherited, see "Smart accessors" in Mail::Field
98
100 Extends "DETAILS" in Mail::Field.
101
103 Error: Undefined subroutine <method> called
104 Mail::Field objects use autoloading to compile new functionality.
105 Apparently, the method called is not implemented for the specific
106 class of the field object.
107
109 This module is part of the MailTools distribution,
110 http://perl.overmeer.net/mailtools/.
111
113 The MailTools bundle was developed by Graham Barr. Later, Mark
114 Overmeer took over maintenance without commitment to further
115 development.
116
117 Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by
118 Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce
119 <Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.
120
122 Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2017 Mark
123 Overmeer <perl@overmeer.net>.
124
125 This program is free software; you can redistribute it and/or modify it
126 under the same terms as Perl itself. See
127 http://www.perl.com/perl/misc/Artistic.html
128
129
130
131perl v5.34.0 2021-07-22 Mail::Field::AddrList(3)