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