See METHODS in Mail::Reporter
Pass a LINE as it could be found in a file: a (possibly folded) line which is terminated by a new-line.
A set of values which shape the line.
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);
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.