See METHODS in Mail::Reporter
The NAME is a wellformed header name (you may use wellformedName()) to be sure about the casing. The BODY is a string, one object, or an ref-array of objects. In case of objects, they must fit to the constructor of the field: the types which are accepted may differ. The optional ATTRIBUTE list contains Mail::Message::Field::Attribute objects. Finally, there are some OPTIONS.
Option | Defined in | Default |
---|---|---|
attributes |
| |
charset | Mail::Message::Field::Full | undef |
datum |
| |
encoding | Mail::Message::Field::Full |
|
force | Mail::Message::Field::Full | false |
language | Mail::Message::Field::Full | undef |
log | Mail::Reporter |
|
trace | Mail::Reporter |
|
my @attrs = (Mail::Message::Field::Attribute->new(...), ...); my @options = (extra => 'the color blue'); my $t = Mail::Message::Field::Full->new(To => \@addrs, @attrs, @options);
Returns a list with attribute name and value pairs.
Add an attribute to the field. The attributes are added left-to-right into the string representation of the field, although the order of the attributes is un-important, according to the RFCs.
You may pass a fully prepared Mail::Message::Field::Attribute $object, if you like to do all preparations for correct representation of the data yourself. You may also pass one STRING, which is a fully prepared attribute. This STRING will not be changed, so be careful about quoting and encodings.
As third possibility, you can specify an attribute $name and its $value. An attribute object will be created for you implicitly in both cases where such object is not supplied, passing the %options. See Mail::Message::Field::Attribute::new() about the available %options.
The attribute object is returned, however, when continuations are used this
may be an object you already know about. undef
is returned when
construction fails (when the attribute is incorrect).
$f->attribute(filename => 'passwd'); $f->attribute(filename => 'passwd', use_continuations => 0); my $attr = Mail::Message::Field::Attribute->new(...); $f->attribute($attr);
Returns a list with all attributes, which are all Mail::Message::Field::Attribute objects. The attributes are not ordered in any way. The list may be empty. Double attributes or continuations are folded into one.
See Parsing in Mail::Message::Field::Full
The part of the field before the semi-colon (;
).