1Email::MIME::Header::AdUdsreerssCLoinsttr(i3b)uted PerlEDmoaciulm:e:nMtIaMtEi:o:nHeader::AddressList(3)
2
3
4

NAME

6       Email::MIME::Header::AddressList - MIME support for list of
7       Email::Address::XS objects
8

VERSION

10       version 1.952
11

SYNOPSIS

13         my $address1 = Email::Address::XS->new('Name1' => 'address1@host.com');
14         my $address2 = Email::Address::XS->new("Name2 \N{U+263A}" => 'address2@host.com');
15         my $mime_address = Email::Address::XS->new('=?UTF-8?B?TmFtZTIg4pi6?=' => 'address2@host.com');
16
17         my $list1 = Email::MIME::Header::AddressList->new($address1, $address2);
18
19         $list1->append_groups('undisclosed-recipients' => []);
20
21         $list1->first_address();
22         # returns $address1
23
24         $list1->groups();
25         # returns (undef, [ $address1, $address2 ], 'undisclosed-recipients', [])
26
27         $list1->as_string();
28         # returns 'Name1 <address1@host.com>, "Name2 ☺" <address2@host.com>, undisclosed-recipients:;'
29
30         $list1->as_mime_string();
31         # returns 'Name1 <address1@host.com>, =?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>, undisclosed-recipients:;'
32
33         my $list2 = Email::MIME::Header::AddressList->new_groups(Group => [ $address1, $address2 ]);
34
35         $list2->append_addresses($address2);
36
37         $list2->addresses();
38         # returns ($address2, $address1, $address2)
39
40         $list2->groups();
41         # returns (undef, [ $address2 ], 'Group', [ $address1, $address2 ])
42
43         my $list3 = Email::MIME::Header::AddressList->new_mime_groups('=?UTF-8?B?4pi6?=' => [ $mime_address ]);
44         $list3->as_string();
45         # returns '☺: "Name2 ☺" <address2@host.com>;'
46
47         my $list4 = Email::MIME::Header::AddressList->from_string('Name1 <address1@host.com>, "Name2 ☺" <address2@host.com>, undisclosed-recipients:;');
48         my $list5 = Email::MIME::Header::AddressList->from_string('Name1 <address1@host.com>', '"Name2 ☺" <address2@host.com>', 'undisclosed-recipients:;');
49
50         my $list6 = Email::MIME::Header::AddressList->from_mime_string('Name1 <address1@host.com>, =?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>, undisclosed-recipients:;');
51         my $list7 = Email::MIME::Header::AddressList->from_mime_string('Name1 <address1@host.com>', '=?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>', 'undisclosed-recipients:;');
52

DESCRIPTION

54       This module implements object representation for the list of the
55       Email::Address::XS objects. It provides methods for RFC 2047
56       <https://tools.ietf.org/html/rfc2047> MIME encoding and decoding
57       suitable for RFC 2822 <https://tools.ietf.org/html/rfc2822> address-
58       list structure.
59
60   EXPORT
61       None
62
63   Class Methods
64       new_empty
65           Construct new empty "Email::MIME::Header::AddressList" object.
66
67       new Construct new "Email::MIME::Header::AddressList" object from list
68           of Email::Address::XS objects.
69
70       new_groups
71           Construct new "Email::MIME::Header::AddressList" object from named
72           groups of Email::Address::XS objects.
73
74       new_mime_groups
75           Like "new_groups" but in this method group names and objects
76           properties are expected to be already MIME encoded, thus ASCII
77           strings.
78
79       from_string
80           Construct new "Email::MIME::Header::AddressList" object from input
81           string arguments.  Calls Email::Address::XS::parse_email_groups.
82
83       from_mime_string
84           Like "from_string" but input string arguments are expected to be
85           already MIME encoded.
86
87   Object Methods
88       as_string
89           Returns string representation of "Email::MIME::Header::AddressList"
90           object.  Calls Email::Address::XS::format_email_groups.
91
92       as_mime_string
93           Like "as_string" but output string will be properly and
94           unambiguously MIME encoded. MIME encoding is done before calling
95           Email::Address::XS::format_email_groups.
96
97       first_address
98           Returns first Email::Address::XS object.
99
100       addresses
101           Returns list of all Email::Address::XS objects.
102
103       groups
104           Like "addresses" but returns objects with named groups.
105
106       append_addresses
107           Append Email::Address::XS objects.
108
109       append_groups
110           Like "append_addresses" but arguments are pairs of name of group
111           and array reference of Email::Address::XS objects.
112

PERL VERSION

114       This library should run on perls released even a long time ago.  It
115       should work on any version of perl released in the last five years.
116
117       Although it may work on older versions of perl, no guarantee is made
118       that the minimum required version will not be increased.  The version
119       may be increased for any reason, and there is no promise that patches
120       will be accepted to lower the minimum required perl.
121

SEE ALSO

123       RFC 2047 <https://tools.ietf.org/html/rfc2047>, RFC 2822
124       <https://tools.ietf.org/html/rfc2822>, Email::MIME, Email::Address::XS
125

AUTHOR

127       Pali <pali@cpan.org>
128

AUTHORS

130       •   Ricardo SIGNES <rjbs@semiotic.systems>
131
132       •   Casey West <casey@geeknest.com>
133
134       •   Simon Cozens <simon@cpan.org>
135
137       This software is copyright (c) 2004 by Simon Cozens and Casey West.
138
139       This is free software; you can redistribute it and/or modify it under
140       the same terms as the Perl 5 programming language system itself.
141
142
143
144perl v5.36.0                      2022-07-22Email::MIME::Header::AddressList(3)
Impressum