See METHODS in Mail::Reporter
Option | Defined in | Default |
---|---|---|
based_on | Mail::Message::Body | undef |
boundary | undef | |
charset | Mail::Message::Body |
|
checked | Mail::Message::Body | <false> |
data | Mail::Message::Body | undef |
description | Mail::Message::Body | undef |
disposition | Mail::Message::Body | undef |
eol | Mail::Message::Body |
|
epilogue | undef | |
file | Mail::Message::Body | undef |
log | Mail::Reporter |
|
message | Mail::Message::Body | undef |
mime_type | Mail::Message::Body |
|
modified | Mail::Message::Body | <false> |
parts | undef | |
preamble | undef | |
trace | Mail::Reporter |
|
transfer_encoding | Mail::Message::Body |
|
my $intro = Mail::Message::Body->new(data => ['part one']); my $pgp = Mail::Message::Body->new(data => ['part three']); my $body = Mail::Message::Body::Multipart->new ( boundary => time . '--it-s-mine' , preamble => "This is a multi-part message in MIME format.\n\n" , parts => [ $intro, $folder->message(3)->decoded, $pgp ] );
An object which is not coercable into a Mail::Message::Part object was passed to the initiation. The data is ignored.
Attach a list of MESSAGES to this multipart. A new body is returned. When you specify BODIES, they will first be translated into real messages. MIME::Entity and Mail::Internet objects may be specified too. In any case, the parts will be coerced into Mail::Message::Part's.
Execute the CODE for each component of the message: the preamble, the epilogue, and each of the parts.
Each component is a body and is passed as second argument to the CODE. The first argument is a reference to this multi-parted body. The CODE returns a body object. When any of the returned bodies differs from the body which was passed, then a new multi-part body will be returned. Reference to the not-changed bodies and the changed bodies will be included in that new multi-part.
my $checked = $multi->foreachComponent(sub {$_[1]->check});
It is NOT possible to call some code for each line of a multipart, because that would not only inflict damage to the body of each message part, but also to the headers and the part separators.
foreachLine() should be used on decoded message bodies only, because it would attempt to modify part-headers and separators as well, which is clearly not acceptible.
Removes all parts which contains data usually defined as being signature.
The MIME::Type module provides this knowledge. A new multipart is
returned, containing the remaining parts. No OPTIONS are defined yet,
although some may be specified, because this method overrules the
stripSignature
method for normal bodies.
Option | Defined in | Default |
---|---|---|
max_lines | Mail::Message::Body::Construct |
|
pattern | Mail::Message::Body::Construct |
|
result_type | Mail::Message::Body::Construct | <same as current> |
Returns the boundary which is used to separate the parts in this body. If none was read from file, then one will be assigned. With STRING you explicitly set the boundary to be used.
Returns the epilogue; the text after the last message part (after the last real attachment). The epilogue is stored in a BODY object, and its encoding is taken from the general multipart header.
Return all parts by default, or when ALL is specified. ACTIVE
returns
the parts which are not flagged for deletion, as opposite to DELETED
.
RECURSE
descents into all nested multiparts to collect all parts.
You may also specify a code reference which is called for each nested part. The first argument will be the message part. When the code returns true, the part is incorporated in the return list.
print "Number of attachments: ", scalar $message->body->parts('ACTIVE'); foreach my $part ($message->body->parts) { print "Type: ", $part->get('Content-Type'); }
Valid choices fdr part selections are ALL
, ACTIVE
, DELETED
,
RECURSE
or a code reference. However, some other argument was passed.
Returns the preamble; the text before the first message part (before the first real attachment). The preamble is stored in a BODY object, and its encoding is taken from the multipart header.