Convert an OBJECT into a Mail::Identity
. On the moment, you can
specify Mail::Address and User::Identity objects. In the
former case, a new Mail::Identity
is created containing the same
information. In the latter, the first address of the user is picked
and returned.
Option | Defined in | Default |
---|---|---|
address | <username@domain or name> | |
charset | <user's charset> | |
comment | <user's fullname if phrase is different> | |
description | User::Identity::Item | undef |
domain | <from email or localhost> | |
language | <from user> | |
location | <random user's location> | |
name | User::Identity::Item | <phrase or user's fullName> |
organization | <location's organization> | |
parent | User::Identity::Item |
|
pgp_key | undef | |
phrase | <user's fullName> | |
signature | undef | |
username | <from address or user's nickname> |
Returns the character set used in comment and phrase. When set to
undef
, the strings (are already encoded to) contain only ASCII
characters. This defaults to the value of the user's charset, if a user
is defined.
E-mail address -when included in message MIME headers- can contain a comment. The RFCs advice not to store useful information in these comments, but it you really want to, you can do it. The comment defaults to the user's fullname if the phrase is not the fullname and there is a user defined.
Comments will be enclosed in parenthesis when used. Parenthesis (matching) or non-matching) which are already in the string will carefully escaped when needed. You do not need to worry.
Returns the language which is used for the description fields of this e-mail address, which defaults to the user's language.
Returns the object which describes to which location this mail address relates. The location may be used to find the name of the organization involved, or to create a signature. If no location is specified, but a user is defined which has locations, one of those is randomly chosen.
Returns the organization which relates to this e-mail identity. If not explicitly specified, it is tried to be found via the location.
The phrase is used in an e-mail address to explain who is sending the message. This usually is the fullname (the user's fullname is used by default), description of your function (Webmaster), or any other text.
When an email string is produced, the phase will be quoted if needed. Quotes which are within the string will automatically be escaped, so you do no need to worry: input cannot break the outcome!
Returns the username of this e-mail address. If none is specified, first it is tried to extract it from the specified e-mail address. If there is also no username in the e-mail address, the user identity's nickname is taken.