{
    "mode": "perldoc",
    "parameter": "Email::MIME::Header::AddressList",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Email%3A%3AMIME%3A%3AHeader%3A%3AAddressList/json",
    "generated": "2026-06-09T13:39:15Z",
    "synopsis": "my $address1 = Email::Address::XS->new('Name1' => 'address1@host.com');\nmy $address2 = Email::Address::XS->new(\"Name2 \\N{U+263A}\" => 'address2@host.com');\nmy $mimeaddress = Email::Address::XS->new('=?UTF-8?B?TmFtZTIg4pi6?=' => 'address2@host.com');\nmy $list1 = Email::MIME::Header::AddressList->new($address1, $address2);\n$list1->appendgroups('undisclosed-recipients' => []);\n$list1->firstaddress();\n# returns $address1\n$list1->groups();\n# returns (undef, [ $address1, $address2 ], 'undisclosed-recipients', [])\n$list1->asstring();\n# returns 'Name1 <address1@host.com>, \"Name2 ☺\" <address2@host.com>, undisclosed-recipients:;'\n$list1->asmimestring();\n# returns 'Name1 <address1@host.com>, =?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>, undisclosed-recipients:;'\nmy $list2 = Email::MIME::Header::AddressList->newgroups(Group => [ $address1, $address2 ]);\n$list2->appendaddresses($address2);\n$list2->addresses();\n# returns ($address2, $address1, $address2)\n$list2->groups();\n# returns (undef, [ $address2 ], 'Group', [ $address1, $address2 ])\nmy $list3 = Email::MIME::Header::AddressList->newmimegroups('=?UTF-8?B?4pi6?=' => [ $mimeaddress ]);\n$list3->asstring();\n# returns '☺: \"Name2 ☺\" <address2@host.com>;'\nmy $list4 = Email::MIME::Header::AddressList->fromstring('Name1 <address1@host.com>, \"Name2 ☺\" <address2@host.com>, undisclosed-recipients:;');\nmy $list5 = Email::MIME::Header::AddressList->fromstring('Name1 <address1@host.com>', '\"Name2 ☺\" <address2@host.com>', 'undisclosed-recipients:;');\nmy $list6 = Email::MIME::Header::AddressList->frommimestring('Name1 <address1@host.com>, =?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>, undisclosed-recipients:;');\nmy $list7 = Email::MIME::Header::AddressList->frommimestring('Name1 <address1@host.com>', '=?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>', 'undisclosed-recipients:;');",
    "sections": {
        "NAME": {
            "content": "Email::MIME::Header::AddressList - MIME support for list of Email::Address::XS objects\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 1.952\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $address1 = Email::Address::XS->new('Name1' => 'address1@host.com');\nmy $address2 = Email::Address::XS->new(\"Name2 \\N{U+263A}\" => 'address2@host.com');\nmy $mimeaddress = Email::Address::XS->new('=?UTF-8?B?TmFtZTIg4pi6?=' => 'address2@host.com');\n\nmy $list1 = Email::MIME::Header::AddressList->new($address1, $address2);\n\n$list1->appendgroups('undisclosed-recipients' => []);\n\n$list1->firstaddress();\n# returns $address1\n\n$list1->groups();\n# returns (undef, [ $address1, $address2 ], 'undisclosed-recipients', [])\n\n$list1->asstring();\n# returns 'Name1 <address1@host.com>, \"Name2 ☺\" <address2@host.com>, undisclosed-recipients:;'\n\n$list1->asmimestring();\n# returns 'Name1 <address1@host.com>, =?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>, undisclosed-recipients:;'\n\nmy $list2 = Email::MIME::Header::AddressList->newgroups(Group => [ $address1, $address2 ]);\n\n$list2->appendaddresses($address2);\n\n$list2->addresses();\n# returns ($address2, $address1, $address2)\n\n$list2->groups();\n# returns (undef, [ $address2 ], 'Group', [ $address1, $address2 ])\n\nmy $list3 = Email::MIME::Header::AddressList->newmimegroups('=?UTF-8?B?4pi6?=' => [ $mimeaddress ]);\n$list3->asstring();\n# returns '☺: \"Name2 ☺\" <address2@host.com>;'\n\nmy $list4 = Email::MIME::Header::AddressList->fromstring('Name1 <address1@host.com>, \"Name2 ☺\" <address2@host.com>, undisclosed-recipients:;');\nmy $list5 = Email::MIME::Header::AddressList->fromstring('Name1 <address1@host.com>', '\"Name2 ☺\" <address2@host.com>', 'undisclosed-recipients:;');\n\nmy $list6 = Email::MIME::Header::AddressList->frommimestring('Name1 <address1@host.com>, =?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>, undisclosed-recipients:;');\nmy $list7 = Email::MIME::Header::AddressList->frommimestring('Name1 <address1@host.com>', '=?UTF-8?B?TmFtZTIg4pi6?= <address2@host.com>', 'undisclosed-recipients:;');\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module implements object representation for the list of the Email::Address::XS objects. It\nprovides methods for RFC 2047 <https://tools.ietf.org/html/rfc2047> MIME encoding and decoding\nsuitable for RFC 2822 <https://tools.ietf.org/html/rfc2822> address-list structure.\n\nEXPORT\nNone\n",
            "subsections": [
                {
                    "name": "Class Methods",
                    "content": "newempty\nConstruct new empty \"Email::MIME::Header::AddressList\" object.\n\nnew Construct new \"Email::MIME::Header::AddressList\" object from list of Email::Address::XS\nobjects.\n\nnewgroups\nConstruct new \"Email::MIME::Header::AddressList\" object from named groups of\nEmail::Address::XS objects.\n\nnewmimegroups\nLike \"newgroups\" but in this method group names and objects properties are expected to be\nalready MIME encoded, thus ASCII strings.\n\nfromstring\nConstruct new \"Email::MIME::Header::AddressList\" object from input string arguments. Calls\nEmail::Address::XS::parseemailgroups.\n\nfrommimestring\nLike \"fromstring\" but input string arguments are expected to be already MIME encoded.\n"
                },
                {
                    "name": "Object Methods",
                    "content": "asstring\nReturns string representation of \"Email::MIME::Header::AddressList\" object. Calls\nEmail::Address::XS::formatemailgroups.\n\nasmimestring\nLike \"asstring\" but output string will be properly and unambiguously MIME encoded. MIME\nencoding is done before calling Email::Address::XS::formatemailgroups.\n\nfirstaddress\nReturns first Email::Address::XS object.\n\naddresses\nReturns list of all Email::Address::XS objects.\n\ngroups\nLike \"addresses\" but returns objects with named groups.\n\nappendaddresses\nAppend Email::Address::XS objects.\n\nappendgroups\nLike \"appendaddresses\" but arguments are pairs of name of group and array reference of\nEmail::Address::XS objects.\n"
                }
            ]
        },
        "PERL VERSION": {
            "content": "This library should run on perls released even a long time ago. It should work on any version of\nperl released in the last five years.\n\nAlthough it may work on older versions of perl, no guarantee is made that the minimum required\nversion will not be increased. The version may be increased for any reason, and there is no\npromise that patches will be accepted to lower the minimum required perl.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "RFC 2047 <https://tools.ietf.org/html/rfc2047>, RFC 2822 <https://tools.ietf.org/html/rfc2822>,\nEmail::MIME, Email::Address::XS\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Pali <pali@cpan.org>\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   Ricardo SIGNES <rjbs@semiotic.systems>\n\n*   Casey West <casey@geeknest.com>\n\n*   Simon Cozens <simon@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is copyright (c) 2004 by Simon Cozens and Casey West.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
            "subsections": []
        }
    },
    "summary": "Email::MIME::Header::AddressList - MIME support for list of Email::Address::XS objects",
    "flags": [],
    "examples": [],
    "see_also": []
}