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 inderstood. Use
39 Mail::Message::Field::Full in MailBox if you need full RFC compliance.
40
42 Constructors
43 Mail::Field::AddrList->combine(FIELDS)
44
45 See "Constructors" in Mail::Field
46
47 Mail::Field::AddrList->extract(TAG, HEAD [, INDEX ])
48
49 See "Constructors" in Mail::Field
50
51 Mail::Field::AddrList->new(TAG [, STRING | OPTIONS])
52
53 See "Constructors" in Mail::Field
54
55 "Fake" constructors
56 $obj->create(OPTIONS)
57
58 See ""Fake" constructors" in Mail::Field
59
60 $obj->parse
61
62 See ""Fake" constructors" in Mail::Field
63
64 Accessors
65 $obj->set(OPTIONS)
66
67 See "Accessors" in Mail::Field
68
69 $obj->stringify
70
71 See "Accessors" in Mail::Field
72
73 $obj->tag
74
75 Mail::Field::AddrList->tag
76
77 See "Accessors" in Mail::Field
78
79 Smart accessors
80 $obj->addr_list
81
82 Returns the collected Mail::Address objects.
83
84 $obj->addresses
85
86 Returns a list if email addresses, found in the field content.
87
88 $obj->names
89
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
95 Add/replace an EMAIL address to the field.
96
97 $obj->text([STRING])
98
99 See "Smart accessors" in Mail::Field
100
103 Error: Undefined subroutine <method> called
104
105 Mail::Field objects use autoloading to compile new functionality.
106 Apparently, the mehod called is not implemented for the specific
107 class of the field object.
108
110 This module is part of the MailTools distribution,
111 http://perl.overmeer.net/mailtools/.
112
114 The MailTools bundle was developed by Graham Barr. Later, Mark
115 Overmeer took over maintenance without commitment to further
116 development.
117
118 Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by
119 Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce
120 <Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.
121
123 Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2007 Mark
124 Overmeer <perl@overmeer.net>.
125
126 This program is free software; you can redistribute it and/or modify it
127 under the same terms as Perl itself. See
128 http://www.perl.com/perl/misc/Artistic.html
129
130
131
132perl v5.12.2 2010-10-01 Mail::Field::AddrList(3)