{
    "content": [
        {
            "type": "text",
            "text": "# Mail::Identity (perldoc)\n\n## NAME\n\nMail::Identity - an e-mail role\n\n## SYNOPSIS\n\nuse User::Identity;\nuse Mail::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = Mail::Identity->new(address => 'x@y');\n$me->add(email => $addr);\n# Simpler\nuse User::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = $me->add(email => 'x@y');\nmy $addr = $me->add( email => 'home'\n, address => 'x@y');\n# Conversion\nmy $ma   = Mail::Address->new(...);\nmy $mi   = Mail::Identity->coerce($ma);\n\n## DESCRIPTION\n\nThe \"Mail::Identity\" object contains the description of role played by a human when sending\ne-mail. Most people have more than one role these days: for instance, a private and a company\nrole with different e-mail addresses.\n\n## Sections\n\n- **NAME**\n- **INHERITANCE**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (4 subsections)\n- **DIAGNOSTICS**\n- **SEE ALSO**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Mail::Identity",
        "section": "",
        "mode": "perldoc",
        "summary": "Mail::Identity - an e-mail role",
        "synopsis": "use User::Identity;\nuse Mail::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = Mail::Identity->new(address => 'x@y');\n$me->add(email => $addr);\n# Simpler\nuse User::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = $me->add(email => 'x@y');\nmy $addr = $me->add( email => 'home'\n, address => 'x@y');\n# Conversion\nmy $ma   = Mail::Address->new(...);\nmy $mi   = Mail::Identity->coerce($ma);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "INHERITANCE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "Constructors",
                        "lines": 44
                    },
                    {
                        "name": "Attributes",
                        "lines": 61
                    },
                    {
                        "name": "Collections",
                        "lines": 24
                    },
                    {
                        "name": "Searching",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Mail::Identity - an e-mail role\n",
                "subsections": []
            },
            "INHERITANCE": {
                "content": "Mail::Identity\nis a User::Identity::Item\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use User::Identity;\nuse Mail::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = Mail::Identity->new(address => 'x@y');\n$me->add(email => $addr);\n\n# Simpler\n\nuse User::Identity;\nmy $me   = User::Identity->new(...);\nmy $addr = $me->add(email => 'x@y');\nmy $addr = $me->add( email => 'home'\n, address => 'x@y');\n\n# Conversion\nmy $ma   = Mail::Address->new(...);\nmy $mi   = Mail::Identity->coerce($ma);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The \"Mail::Identity\" object contains the description of role played by a human when sending\ne-mail. Most people have more than one role these days: for instance, a private and a company\nrole with different e-mail addresses.\n\nAn \"Mail::Identity\" object combines an e-mail address, user description (\"phrase\"), a signature,\npgp-key, and so on. All fields are optional, and some fields are smart. One such set of data\nrepresents one role. \"Mail::Identity\" is therefore the smart cousine of the Mail::Address\nobject.\n\nExtends \"DESCRIPTION\" in User::Identity::Item.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "Extends \"METHODS\" in User::Identity::Item.\n",
                "subsections": [
                    {
                        "name": "Constructors",
                        "content": "Extends \"Constructors\" in User::Identity::Item.\n\nMail::Identity->new( [$name], %options )\n-Option      --Defined in          --Default\naddress                             <username@domain or name>\ncharset                             <user's charset>\ncomment                             <user's fullname if phrase is different>\ndescription   User::Identity::Item  undef\ndomain                              <from email or localhost>\nlanguage                            <from user>\nlocation                            <random user's location>\nname          User::Identity::Item  <phrase or user's fullName>\norganization                        <location's organization>\nparent        User::Identity::Item  undef\npgpkey                             undef\nphrase                              <user's fullName>\nsignature                           undef\nusername                            <from address or user's nickname>\n\naddress => STRING\nThe e-mail address is constructed from the username/domain, but when both do not exist,\nthe name is taken.\n\ncharset => STRING\ncomment => STRING\ndescription => STRING\ndomain => STRING\nlanguage => STRING\nlocation => NAME|OBJECT\nThe user's location which relates to this mail identity. This can be specified as location\nname (which will be looked-up when needed), or as User::Identity::Location object.\n\nname => STRING\norganization => STRING\nUsually defined for e-mail addresses which are used by a company or other organization,\nbut less common for personal addresses. This value will be used to fill the \"Organization\"\nheader field of messages.\n\nparent => OBJECT\npgpkey => STRING|FILENAME\nphrase => STRING\nsignature => STRING\nusername => STRING\n"
                    },
                    {
                        "name": "Attributes",
                        "content": "Extends \"Attributes\" in User::Identity::Item.\n\n$obj->address()\nReturns the e-mail address for this role. If none was specified, it will be constructed from\nthe username and domain. If those are not present as well, then the name() is used when it\ncontains a \"@\", else the user's nickname is taken.\n\n$obj->charset()\nReturns the character set used in comment and phrase. When set to \"undef\", the strings (are\nalready encoded to) contain only ASCII characters. This defaults to the value of the user's\ncharset, if a user is defined.\n\n$obj->comment( [STRING] )\nE-mail address -when included in message MIME headers- can contain a comment. The RFCs\nadvice not to store useful information in these comments, but it you really want to, you can\ndo it. The comment defaults to the user's fullname if the phrase is not the fullname and\nthere is a user defined.\n\nComments will be enclosed in parenthesis when used. Parenthesis (matching) or non-matching)\nwhich are already in the string will carefully escaped when needed. You do not need to\nworry.\n\n$obj->description()\nInherited, see \"Attributes\" in User::Identity::Item\n\n$obj->domain()\nThe domain is the part of the e-mail address after the \"@\"-sign. When this is not defined,\nit can be deducted from the email address (see address()). If nothing is known, \"localhost\"\nis returned.\n\n$obj->language()\nReturns the language which is used for the description fields of this e-mail address, which\ndefaults to the user's language.\n\n$obj->location()\nReturns the object which describes to which location this mail address relates. The location\nmay be used to find the name of the organization involved, or to create a signature. If no\nlocation is specified, but a user is defined which has locations, one of those is randomly\nchosen.\n\n$obj->name( [$newname] )\nInherited, see \"Attributes\" in User::Identity::Item\n\n$obj->organization()\nReturns the organization which relates to this e-mail identity. If not explicitly specified,\nit is tried to be found via the location.\n\n$obj->phrase()\nThe phrase is used in an e-mail address to explain who is sending the message. This usually\nis the fullname (the user's fullname is used by default), description of your function\n(Webmaster), or any other text.\n\nWhen an email string is produced, the phase will be quoted if needed. Quotes which are\nwithin the string will automatically be escaped, so you do no need to worry: input cannot\nbreak the outcome!\n\n$obj->username()\nReturns the username of this e-mail address. If none is specified, first it is tried to\nextract it from the specified e-mail address. If there is also no username in the e-mail\naddress, the user identity's nickname is taken.\n"
                    },
                    {
                        "name": "Collections",
                        "content": "Extends \"Collections\" in User::Identity::Item.\n\n$obj->add($collection, $role)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->addCollection( $object | <[$type], %options> )\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->collection($name)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->parent( [$parent] )\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->removeCollection($object|$name)\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->type()\nMail::Identity->type()\nInherited, see \"Collections\" in User::Identity::Item\n\n$obj->user()\nInherited, see \"Collections\" in User::Identity::Item\n"
                    },
                    {
                        "name": "Searching",
                        "content": "Extends \"Searching\" in User::Identity::Item.\n\n$obj->find($collection, $role)\nInherited, see \"Searching\" in User::Identity::Item\n"
                    }
                ]
            },
            "DIAGNOSTICS": {
                "content": "Error: $object is not a collection.\nThe first argument is an object, but not of a class which extends\nUser::Identity::Collection.\n\nError: Cannot load collection module for $type ($class).\nEither the specified $type does not exist, or that module named $class returns compilation\nerrors. If the type as specified in the warning is not the name of a package, you specified\na nickname which was not defined. Maybe you forgot the 'require' the package which defines\nthe nickname.\n\nError: Creation of a collection via $class failed.\nThe $class did compile, but it was not possible to create an object of that class using the\noptions you specified.\n\nError: Don't know what type of collection you want to add.\nIf you add a collection, it must either by a collection object or a list of options which\ncan be used to create a collection object. In the latter case, the type of collection must\nbe specified.\n\nWarning: No collection $name\nThe collection with $name does not exist and can not be created.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "This module is part of User-Identity distribution version 1.01, built on February 11, 2022.\nWebsite: http://perl.overmeer.net/CPAN/\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyrights 2003-2022 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
                "subsections": []
            }
        }
    }
}