Mail::Message::Body::Nested โ body of a message which contains a message
| Use Case | Command | Description |
|---|---|---|
| Check if a body is nested | $body->isNested | ๐ Returns true if the body contains a nested message |
| Access the nested message | $body->nested | ๐ Returns the Mail::Message::Part enclosed in this body |
| Create a new nested body | Mail::Message::Body::Nested->new(nested => $msg) | ๐ Encapsulate a message inside a nested body |
| Execute code on nested message | $body->forNested(CODE) | ๐ Runs CODE on the nested message, returns new nested body or undef |
| NOTE: Cannot iterate lines | $body->foreachLine | โ ๏ธ Allowed โ would damage the header of the encapsulated message |
See Mail::Message::Body
if($body->isNested) {
my $nest = $body->nested;
$nest->delete;
}
The body (content) of a message can be stored in various ways. In this manual-page you find the description of extra functionality you have when a message contains a nested message, like "message/rfc822".
A nested message is different from a multipart message which contains only one element, because a nested message has a full set of message header fields defined by the RFC882, where a part of a multipart has only a few. But because we do not keep track whether all fields are presented, a Mail::Message::Part is used anyway.
Extends "DESCRIPTION" in Mail::Message::Body.
Extends "OVERLOADED" in Mail::Message::Body.
overload: "" โ Inherited, see "OVERLOADED" in Mail::Message::Bodyoverload: '==' and '!=' โ Inherited, see "OVERLOADED" in Mail::Message::Bodyoverload: @{} โ Inherited, see "OVERLOADED" in Mail::Message::Bodyoverload: bool โ Inherited, see "OVERLOADED" in Mail::Message::BodyExtends "METHODS" in Mail::Message::Body.
Extends "Constructors" in Mail::Message::Body.
$obj->clone() โ Inherited, see "Constructors" in Mail::Message::BodyMail::Message::Body::Nested->new(%options)Options:
based_on | โ Mail::Message::Body | Default: undef |
charset | โ Mail::Message::Body | Default: 'PERL' or <undef> |
checked | โ Mail::Message::Body | Default: <false> |
content_id | โ Mail::Message::Body | Default: undef |
data | โ Mail::Message::Body | Default: undef |
description | โ Mail::Message::Body | Default: undef |
disposition | โ Mail::Message::Body | Default: undef |
eol | โ Mail::Message::Body | Default: 'NATIVE' |
file | โ Mail::Message::Body | Default: undef |
filename | โ Mail::Message::Body | Default: undef |
log | โ Mail::Reporter | Default: 'WARNINGS' |
message | โ Mail::Message::Body | Default: undef |
mime_type | โ Mail::Message::Body | Default: 'message/rfc822' |
modified | โ Mail::Message::Body | Default: <false> |
nested | โ Mail::Message::Body::Nested | Default: undef โ The message which is encapsulated within this body. |
trace | โ Mail::Reporter | Default: 'WARNINGS' |
transfer_encoding | โ Mail::Message::Body | Default: 'none' |
Examples:
my $msg = $folder->message(3);
my $encaps= Mail::Message::Body::Nested->new(nested => $msg);
# The body will be coerced into a message, which lacks a few
# lines but we do not bother.
my $intro = Mail::Message::Body->new(data => ...);
my $body = Mail::Message::Body::Nested->new(nested => $intro);
Extends "Constructing a body" in Mail::Message::Body.
$obj->attach($messages, %options) โ Inherited, see "Constructing a body" in Mail::Message::Body::Construct$obj->check() โ Inherited, see "Constructing a body" in Mail::Message::Body::Encode$obj->concatenate($components) โ Inherited, see "Constructing a body" in Mail::Message::Body::Construct$obj->decoded(%options) โ Inherited, see "Constructing a body" in Mail::Message::Body$obj->encode(%options) โ Inherited, see "Constructing a body" in Mail::Message::Body::Encode$obj->encoded() โ Inherited, see "Constructing a body" in Mail::Message::Body::Encode$obj->eol( ['CR'|'LF'|'CRLF'|'NATIVE'] ) โ Inherited, see "Constructing a body" in Mail::Message::Body$obj->foreachLine(CODE) โ โ ๏ธ It is NOT possible to call some code for each line of a nested because that would damage the header of the encapsulated message$obj->stripSignature(%options) โ Inherited, see "Constructing a body" in Mail::Message::Body::Construct$obj->unify($body) โ Inherited, see "Constructing a body" in Mail::Message::Body::EncodeExtends "The body" in Mail::Message::Body.
$obj->isDelayed() โ Inherited, see "The body" in Mail::Message::Body$obj->isMultipart() โ Inherited, see "The body" in Mail::Message::Body$obj->isNested() โ Inherited, see "The body" in Mail::Message::Body$obj->message( [$message] ) โ Inherited, see "The body" in Mail::Message::Body$obj->partNumberOf($part) โ Inherited, see "The body" in Mail::Message::BodyExtends "About the payload" in Mail::Message::Body.
$obj->charset() โ Inherited, see "About the payload" in Mail::Message::Body$obj->checked( [BOOLEAN] ) โ Inherited, see "About the payload" in Mail::Message::Body$obj->contentId( [STRING|$field] ) โ Inherited, see "About the payload" in Mail::Message::Body$obj->description( [STRING|$field] ) โ Inherited, see "About the payload" in Mail::Message::Body$obj->disposition( [STRING|$field] ) โ Inherited, see "About the payload" in Mail::Message::Body$obj->dispositionFilename( [$directory] ) โ Inherited, see "About the payload" in Mail::Message::Body::Encode$obj->isBinary() โ Inherited, see "About the payload" in Mail::Message::Body::Encode$obj->isText() โ Inherited, see "About the payload" in Mail::Message::Body::Encode$obj->mimeType() โ Inherited, see "About the payload" in Mail::Message::Body$obj->nrLines() โ Inherited, see "About the payload" in Mail::Message::Body$obj->size() โ Inherited, see "About the payload" in Mail::Message::Body$obj->transferEncoding( [STRING|$field] ) โ Inherited, see "About the payload" in Mail::Message::Body$obj->type( [STRING|$field] ) โ Inherited, see "About the payload" in Mail::Message::BodyExtends "Access to the payload" in Mail::Message::Body.
$obj->endsOnNewline() โ Inherited, see "Access to the payload" in Mail::Message::Body$obj->file() โ Inherited, see "Access to the payload" in Mail::Message::Body$obj->forNested(CODE) โ Execute the CODE for the nested message. This returns a new nested body object. Returns "undef" when the CODE returns "undef".$obj->lines() โ Inherited, see "Access to the payload" in Mail::Message::Body$obj->nested() โ Returns the Mail::Message::Part message which is enclosed within this body.$obj->print( [$fh] ) โ Inherited, see "Access to the payload" in Mail::Message::Body$obj->printEscapedFrom($fh) โ Inherited, see "Access to the payload" in Mail::Message::Body$obj->string() โ Inherited, see "Access to the payload" in Mail::Message::Body$obj->stripTrailingNewline() โ Inherited, see "Access to the payload" in Mail::Message::Body$obj->write(%options) โ Inherited, see "Access to the payload" in Mail::Message::BodyExtends "Internals" in Mail::Message::Body.
$obj->addTransferEncHandler( $name, <$class|$object> )Mail::Message::Body::Nested->addTransferEncHandler( $name, <$class|$object> ) โ Inherited, see "Internals" in Mail::Message::Body::Encode$obj->contentInfoFrom($head) โ Inherited, see "Internals" in Mail::Message::Body$obj->contentInfoTo($head) โ Inherited, see "Internals" in Mail::Message::Body$obj->fileLocation( [$begin, $end] ) โ Inherited, see "Internals" in Mail::Message::Body$obj->getTransferEncHandler($type) โ Inherited, see "Internals" in Mail::Message::Body::Encode$obj->isModified() โ Inherited, see "Internals" in Mail::Message::Body$obj->load() โ Inherited, see "Internals" in Mail::Message::Body$obj->modified( [BOOLEAN] ) โ Inherited, see "Internals" in Mail::Message::Body$obj->moveLocation( [$distance] ) โ Inherited, see "Internals" in Mail::Message::Body$obj->read( $parser, $head, $bodytype, [$chars, [$lines]] ) โ Inherited, see "Internals" in Mail::Message::BodyExtends "Error handling" in Mail::Message::Body.
$obj->AUTOLOAD() โ Inherited, see "Error handling" in Mail::Message::Body$obj->addReport($object) โ Inherited, see "Error handling" in Mail::Reporter$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )Mail::Message::Body::Nested->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->errors() โ Inherited, see "Error handling" in Mail::Reporter$obj->log( [$level, [$strings]] )Mail::Message::Body::Nested->log( [$level, [$strings]] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->logPriority($level)Mail::Message::Body::Nested->logPriority($level) โ Inherited, see "Error handling" in Mail::Reporter$obj->logSettings() โ Inherited, see "Error handling" in Mail::Reporter$obj->notImplemented() โ Inherited, see "Error handling" in Mail::Reporter$obj->report( [$level] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->reportAll( [$level] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->trace( [$level] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->warnings() โ Inherited, see "Error handling" in Mail::ReporterExtends "Cleanup" in Mail::Message::Body.
$obj->DESTROY() โ Inherited, see "Cleanup" in Mail::ReporterExtends "DETAILS" in Mail::Message::Body.
This module is part of Mail-Message distribution version 3.012, built on February 11, 2022. Website: http://perl.overmeer.net/CPAN/
Copyrights 2001-2022 by [Mark Overmeer <markov AT cpan.org>]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-27 09:44 @216.73.216.194
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format