See METHODS in Mail::Reporter
Create a new attribute NAME with the optional VALUE. If no VALUE is specified,
the first argument of this method is inspected for an equals sign '='
.
If that character is present, the argument is taken as STRING, containing
a preformatted attribute which is processed. Otherwise, the argument is
taken as name without VALUE: set the value later with value().
Whether encoding takes place depends on the OPTIONS and the existence of non-ascii characters in the VALUE. The NAME can only contain ascii characters, hence is never encoded.
To speed things up, attributes are not derived from the Mail::Reporter base-class.
Option | Defined in | Default |
---|---|---|
charset |
| |
language | undef | |
log | Mail::Reporter |
|
trace | Mail::Reporter |
|
use_continuations | <true> |
my $fn = Mail::Message::Field::Attribute ->new(filename => 'xyz'); my $fattr = 'Mail::Message::Field::Attribute'; # abbrev my $fn = $fattr->new ( filename => "Re\xC7u" , charset => 'iso-8859-15' , language => 'nl-BE' ); print $fn; # --> filename*=iso-8859-15'nl-BE'Re%C7u
The specified parameter name contains characters which are not permitted by the RFCs. You can better change the name into something which is accepted, or risk applications to corrupt or ignore the message.
A component is a parameter as defined by RFC2045, optionally using encoding or continuations as defined by RFC2231. Components of an attribute are found when a field is being parsed. The RFCs are very strict on valid characters, but we cannot be: you have to accept what is coming in if you can.
my $param = Mail::Message::Field::Attribute->new; $param->addComponent("filename*=iso10646'nl-BE'%Re\47u");
Returns the character set which is used for this parameter. If any component is added which contains character set information, this is directly available. Be warned that a character-set is case insensitive.
Returns the language which is defined in the argument. If no language is
defined undef
is returned, which should be interpreted as "ANY"
Returns the name of this attribute.
Returns the parameter as reference to an array of lines. When only one line is returned, it may be short enough to fit on the same line with other components of the header field.
Returns the value of this parameter, optionally after setting it first.
Translate all known continuations into a value. The produced value is returned and may be utf-8 encoded or a plain string.
Merge the components from the specified attribute in this attribute. This is needed when components of the same attribute are created separately. Merging is required by the field parsing.