{
    "mode": "perldoc",
    "parameter": "Mail::Field::AddrList",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AField%3A%3AAddrList/json",
    "generated": "2026-06-12T19:05:29Z",
    "synopsis": "use Mail::Field::AddrList;\n$to   = Mail::Field->new('To');\n$from = Mail::Field->new('From', 'poe@daimi.aau.dk (Peter Orbaek)');\n$from->create('foo@bar.com' => 'Mr. Foo', poe => 'Peter');\n$from->parse('foo@bar.com (Mr Foo), Peter Orbaek <poe>');\n# make a RFC822 header string\nprint $from->stringify(),\"\\n\";\n# extract e-mail addresses and names\n@addresses = $from->addresses(); # strings\n@names     = $from->names();     # strings\n@addr      = $from->addrlist(); # Mail::Address objects (v2.00)\n# adjoin a new address to the list\n$from->setaddress('foo@bar.com', 'Mr. Foo');",
    "sections": {
        "NAME": {
            "content": "Mail::Field::AddrList - object representation of e-mail address lists\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "Mail::Field::AddrList\nis a Mail::Field\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Mail::Field::AddrList;\n\n$to   = Mail::Field->new('To');\n$from = Mail::Field->new('From', 'poe@daimi.aau.dk (Peter Orbaek)');\n\n$from->create('foo@bar.com' => 'Mr. Foo', poe => 'Peter');\n$from->parse('foo@bar.com (Mr Foo), Peter Orbaek <poe>');\n\n# make a RFC822 header string\nprint $from->stringify(),\"\\n\";\n\n# extract e-mail addresses and names\n@addresses = $from->addresses(); # strings\n@names     = $from->names();     # strings\n@addr      = $from->addrlist(); # Mail::Address objects (v2.00)\n\n# adjoin a new address to the list\n$from->setaddress('foo@bar.com', 'Mr. Foo');\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Defines parsing and formatting of address field, for the following fields: \"To\", \"From\", \"Cc\",\n\"Reply-To\", and \"Sender\".\n\nAll the normally used features of the address field specification of RFC2822 are implemented,\nbut some complex (and therefore hardly ever used) constructs will not be understood. Use\nMail::Message::Field::Full in MailBox if you need full RFC compliance.\n\nExtends \"DESCRIPTION\" in Mail::Field.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in Mail::Field.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in Mail::Field.\n\nMail::Field::AddrList->combine($fields)\nInherited, see \"Constructors\" in Mail::Field\n\nMail::Field::AddrList->extract( $tag, $head [, $index ] )\nInherited, see \"Constructors\" in Mail::Field\n\nMail::Field::AddrList->new( $tag [, STRING | %options] )\nInherited, see \"Constructors\" in Mail::Field\n\n\"Fake\" constructors\nExtends \"\"Fake\" constructors\" in Mail::Field.\n\n$obj->create(%options)\nInherited, see \"\"Fake\" constructors\" in Mail::Field\n\n$obj->parse()\nInherited, see \"\"Fake\" constructors\" in Mail::Field\n"
                },
                {
                    "name": "Accessors",
                    "content": "Extends \"Accessors\" in Mail::Field.\n\n$obj->set(%options)\nInherited, see \"Accessors\" in Mail::Field\n\n$obj->stringify()\nInherited, see \"Accessors\" in Mail::Field\n\n$obj->tag()\nMail::Field::AddrList->tag()\nInherited, see \"Accessors\" in Mail::Field\n"
                },
                {
                    "name": "Smart accessors",
                    "content": "Extends \"Smart accessors\" in Mail::Field.\n\n$obj->addrlist()\nReturns the collected Mail::Address objects.\n\n$obj->addresses()\nReturns a list if email addresses, found in the field content.\n\n$obj->names()\nReturns a list of nicely formatted named, for each of the addresses found in the content.\n\n$obj->setaddress($email, $name)\nAdd/replace an $email address to the field.\n\n$obj->text( [STRING] )\nInherited, see \"Smart accessors\" in Mail::Field\n"
                }
            ]
        },
        "DETAILS": {
            "content": "Extends \"DETAILS\" in Mail::Field.\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "Error: Undefined subroutine <method> called\nMail::Field objects use autoloading to compile new functionality. Apparently, the method\ncalled is not implemented for the specific class of the field object.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance\nwithout commitment to further development.\n\nMail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>.\nMail::Mailer and Mail::Send by Tim Bunce <Tim.Bunce@ig.co.uk>. For other contributors see\nChangeLog.\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2017 Mark Overmeer\n<perl@overmeer.net>.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://www.perl.com/perl/misc/Artistic.html\n",
            "subsections": []
        }
    },
    "summary": "Mail::Field::AddrList - object representation of e-mail address lists",
    "flags": [],
    "examples": [],
    "see_also": []
}