Mail::...Message(3pm)

๐Ÿ’– NAME ๐Ÿ’–

okay so this is Mail::Box::Net::Message โ€” one message from a distant folder ๐ŸŒˆ โ€” and it lives on the 3pm shelf, aka your friendly neighborhood User Contributed Perl Documentation. perldoc bestie, we're in it ๐Ÿซถ


๐Ÿฆ‹ INHERITANCE ๐Ÿฆ‹

this baby has a whole family tree, no cap. look at the lore:

Mail::Box::Net::Message
  is a Mail::Box::Message
  is a Mail::Message
  is a Mail::Reporter

Mail::Box::Net::Message is extended by
  Mail::Box::IMAP4::Message
  Mail::Box::POP3::Message

so it is a Mail::Box::Message, which is a Mail::Message, which is a Mail::Reporter. and then Mail::Box::IMAP4::Message and Mail::Box::POP3::Message extend it. generational icon behavior honestly ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

the little taste test, exactly as written:

my $folder = Mail::Box:POP3->new(...);
my $message = $folder->message(10);

(yes, that colon in Mail::Box:POP3 is literally what the docs say, we do not touch the sacred text ๐Ÿ’…)


๐ŸŒธ DESCRIPTION ๐ŸŒธ

a Mail::Box::Net::Message is one message in a folder that you can only get to through some kind of protocol. remote baddie energy.

right now โ€” "on this moment", as the source says โ€” only a POP3 client is actually available. IMAP, DBI, and NNTP are the other candidates ๐Ÿ‘€ so like, they're on the vision board.

also: Extends "DESCRIPTION" in Mail::Box::Message.


๐ŸŽ€ METHODS ๐ŸŽ€

Extends "METHODS" in Mail::Box::Message.

๐Ÿ’ซ Constructors

Extends "Constructors" in Mail::Box::Message.

  • $obj->clone(%options) โ€” inherited, bestie ๐Ÿ’– see "Constructors" in Mail::Message
  • $class->new(%options) โ€” inherited ๐Ÿ’– see "Constructors" in Mail::Reporter

now the option menu for new, and the defaults are giving very much:

 -Option    --Defined in        --Default
  body        Mail::Message       undef
  body_type   Mail::Box::Message  <from folder>
  deleted     Mail::Message       false
  field_type  Mail::Message       undef
  folder      Mail::Box::Message  <required>
  head        Mail::Message       undef
  head_type   Mail::Message       Mail::Message::Head::Complete
  labels      Mail::Message       +{}
  messageId   Mail::Message       undef
  message_id  Mail::Message       undef
  modified    Mail::Message       false
  size        Mail::Box::Message  undef
  trusted     Mail::Message       false
  unique                          <unique string>

and here's each one laid out flat, no crumbs left behind:

  • body => $object โ€” a body object goes here.
  • body_type => CODE|$class โ€” code ref or class name, your call.
  • deleted => BOOLEAN โ€” yep, boolean.
  • field_type => $class โ€” a class name.
  • folder => $folder โ€” a folder. it's marked <required> up there, so do not skip her ๐Ÿ™ˆ
  • head => $object โ€” a head object goes here.
  • head_type => $class โ€” a class name.
  • labels => @pairs|%settings โ€” array-of-pairs ref or hash-of-settings ref, either format eats.
  • messageId => $id โ€” an id.
  • message_id => $id โ€” also an id. no that's not a typo, both spellings really are listed, iykyk ๐Ÿ’€
  • modified => BOOLEAN โ€” boolean, yes.
  • size => $bytes โ€” size in bytes.
  • trusted => BOOLEAN โ€” boolean again, slay.
  • unique => STRING โ€” "the unique keys which identifies this message on the remote server." that's the glow-up name tag for this message over on the remote side ๐Ÿ”ฅ

๐Ÿงš Attributes

Extends "Attributes" in Mail::Box::Message.

  • $obj->bodyType() โ€” inherited, see "Attributes" in Mail::Message
  • $obj->fieldType() โ€” inherited, see "Attributes" in Mail::Message
  • $obj->folder( [$folder] ) โ€” inherited, see "Attributes" in Mail::Box::Message
  • $obj->headType() โ€” inherited, see "Attributes" in Mail::Message
  • $obj->messageId() โ€” inherited, see "Attributes" in Mail::Message
  • $obj->seqnr( [$integer] ) โ€” inherited, see "Attributes" in Mail::Box::Message
  • $obj->unique( [STRING|undef] ) โ€” okay so this one returns the name of the file in which this message is actually stored ๐Ÿ“. it will return "undef" when the message is not stored in a file. and when you hand it a "STRING", a new identifier gets stored first. periodt.

๐ŸŽ€ Constructing a message

Extends "Constructing a message" in Mail::Box::Message.

  • $obj->bounce( [<$rg_object|%options>] ) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Bounce
  • $class->build( [$message|$part|$body], @fields, %options ) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Build
  • $class->buildFromBody($body, [$head], $headers) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Build
  • $obj->forward(%options) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Forward
  • $obj->forwardAttach(%options) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Forward
  • $obj->forwardEncapsulate(%options) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Forward
  • $obj->forwardInline(%options) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Forward
  • $obj->forwardNo(%options) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Forward
  • $obj->forwardPostlude() โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Forward
  • $obj->forwardPrelude() โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Forward
  • $obj->forwardSubject(STRING) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Forward
  • $class->read($fh|$text|\$text|\@lines, %options) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Read
  • $obj->rebuild(%options) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Rebuild
  • $obj->reply(%options) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Reply
  • $obj->replyPrelude( [STRING|$field|$address|\@addrs|\@fields] ) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Reply
  • $any->replySubject(STRING) โ€” inherited, see "Constructing a message" in Mail::Message::Construct::Reply

๐ŸŒˆ The message

Extends "The message" in Mail::Box::Message.

  • $obj->container() โ€” inherited, see "The message" in Mail::Message
  • $obj->copyTo($folder, %options) โ€” inherited, see "The message" in Mail::Box::Message
  • $obj->endsOnNewline() โ€” inherited, see "The message" in Mail::Message
  • $obj->isDummy() โ€” inherited, see "The message" in Mail::Message
  • $obj->isPart() โ€” inherited, see "The message" in Mail::Message
  • $obj->moveTo($folder, %options) โ€” inherited, see "The message" in Mail::Box::Message
  • $obj->partNumber() โ€” inherited, see "The message" in Mail::Message
  • $obj->print( [$fh] ) โ€” inherited, see "The message" in Mail::Message
  • $obj->send( [$mailer], %options ) โ€” inherited, see "The message" in Mail::Message
  • $obj->size() โ€” inherited, see "The message" in Mail::Message
  • $obj->toplevel() โ€” inherited, see "The message" in Mail::Message
  • $obj->write( [$fh] ) โ€” inherited, see "The message" in Mail::Message

๐Ÿ’œ The header

Extends "The header" in Mail::Box::Message.

  • $obj->bcc() โ€” inherited, see "The header" in Mail::Message
  • $obj->cc() โ€” inherited, see "The header" in Mail::Message
  • $obj->date() โ€” inherited, see "The header" in Mail::Message
  • $obj->destinations() โ€” inherited, see "The header" in Mail::Message
  • $obj->from() โ€” inherited, see "The header" in Mail::Message
  • $obj->get($fieldname) โ€” inherited, see "The header" in Mail::Message
  • $obj->guessTimestamp() โ€” inherited, see "The header" in Mail::Message
  • $obj->head( [$head] ) โ€” inherited, see "The header" in Mail::Message
  • $obj->nrLines() โ€” inherited, see "The header" in Mail::Message
  • $obj->sender() โ€” inherited, see "The header" in Mail::Message
  • $obj->study($fieldname) โ€” inherited, see "The header" in Mail::Message
  • $obj->subject() โ€” inherited, see "The header" in Mail::Message
  • $obj->timestamp() โ€” inherited, see "The header" in Mail::Message
  • $obj->to() โ€” inherited, see "The header" in Mail::Message

๐Ÿ“ The body

Extends "The body" in Mail::Box::Message.

  • $obj->body( [$body] ) โ€” inherited, see "The body" in Mail::Message
  • $obj->contentType() โ€” inherited, see "The body" in Mail::Message
  • $obj->decoded(%options) โ€” inherited, see "The body" in Mail::Message
  • $obj->encode(%options) โ€” inherited, see "The body" in Mail::Message
  • $obj->isMultipart() โ€” inherited, see "The body" in Mail::Message
  • $obj->isNested() โ€” inherited, see "The body" in Mail::Message
  • $obj->parts( [<'ALL'|'ACTIVE'|'DELETED'|'RECURSE'|$filter>] ) โ€” inherited, see "The body" in Mail::Message

๐Ÿ’… Flags

Extends "Flags" in Mail::Box::Message.

  • $obj->delete() โ€” inherited, see "Flags" in Mail::Message
  • $obj->deleted( [BOOLEAN] ) โ€” inherited, see "Flags" in Mail::Message
  • $obj->isDeleted() โ€” inherited, see "Flags" in Mail::Message
  • $obj->isModified() โ€” inherited, see "Flags" in Mail::Message
  • $obj->label($label|PAIRS) โ€” inherited, see "Flags" in Mail::Message
  • $obj->labels() โ€” inherited, see "Flags" in Mail::Message
  • $obj->labelsToStatus() โ€” inherited, see "Flags" in Mail::Message
  • $obj->modified( [BOOLEAN] ) โ€” inherited, see "Flags" in Mail::Message
  • $obj->statusToLabels() โ€” inherited, see "Flags" in Mail::Message

๐Ÿ”ฅ The whole message as text

Extends "The whole message as text" in Mail::Box::Message.

  • $obj->file() โ€” inherited, see "The whole message as text" in Mail::Message::Construct::Text
  • $obj->lines() โ€” inherited, see "The whole message as text" in Mail::Message::Construct::Text
  • $obj->printStructure( [$fh|undef],[$indent] ) โ€” inherited, see "The whole message as text" in Mail::Message::Construct::Text
  • $obj->string() โ€” inherited, see "The whole message as text" in Mail::Message::Construct::Text

๐Ÿ‘‘ Internals

Extends "Internals" in Mail::Box::Message.

  • $obj->clonedFrom() โ€” inherited, see "Internals" in Mail::Message
  • $class->coerce($message, %options) โ€” inherited, see "Internals" in Mail::Message
  • $obj->diskDelete() โ€” inherited, see "Internals" in Mail::Box::Message
  • $obj->isDelayed() โ€” inherited, see "Internals" in Mail::Message
  • $obj->isTrusted() โ€” inherited, see "Internals" in Mail::Message
  • $obj->loadBody() โ€” no "inherited" note on this one bestie, it's listed right here under Internals with nothing else attached.
  • $obj->readBody( $parser, $head, [$bodytype] ) โ€” inherited, see "Internals" in Mail::Box::Message
  • $obj->readFromParser( $parser, [$bodytype] ) โ€” inherited, see "Internals" in Mail::Message
  • $obj->readHead( $parser, [$class] ) โ€” inherited, see "Internals" in Mail::Message
  • $obj->recursiveRebuildPart($part, %options) โ€” inherited, see "Internals" in Mail::Message::Construct::Rebuild
  • $obj->storeBody($body) โ€” inherited, see "Internals" in Mail::Message
  • $obj->takeMessageId( [STRING] ) โ€” inherited, see "Internals" in Mail::Message

๐Ÿ™ˆ Error handling

Extends "Error handling" in Mail::Box::Message.

  • $obj->AUTOLOAD() โ€” inherited, see "METHODS" in Mail::Message::Construct
  • $obj->notImplemented() โ€” inherited, see "Error handling" in Mail::Reporter
  • $any->shortSize( [$value] ) โ€” inherited, see "Error handling" in Mail::Message
  • $obj->shortString() โ€” inherited, see "Error handling" in Mail::Message

๐Ÿงผ Cleanup

Extends "Cleanup" in Mail::Box::Message.

  • $obj->DESTROY() โ€” inherited, see "Cleanup" in Mail::Reporter
  • $obj->destruct() โ€” inherited, see "Cleanup" in Mail::Box::Message

โญ DETAILS โญ

Extends "DETAILS" in Mail::Box::Message.


and that's the tea so far โ˜• part 2 is still coming, bestie โ€” don't go anywhere ๐Ÿ’–

๐Ÿฉบ๐Ÿ’– DIAGNOSTICS ๐Ÿ’–๐Ÿฉบ

okay bestie, this is the part where the module is like "hey, here's what went wrong, and yes I'm telling you exactly which method snitched on you." every single one of these is real, so read the whole list, no skipping ๐Ÿ’…

  • Error: Cannot include forward source as $kind. โ€” so you handed forward(include) an alternative it does not vibe with. the only choices it accepts, periodt, are "NO", "INLINE", "ATTACH", and "ENCAPSULATE". thrown by forward() ๐Ÿซถ
  • Error: No default mailer found to send message. โ€” the send() machinery lowkey did not have enough info to go find a mail transfer agent all by itself to send this message. so just tell it one explicitly using the via options. thrown by send() โœจ
  • Error: cannot coerce a $type object into a $me object. โ€” thrown by coerce() ๐Ÿ™ˆ
  • Error: cannot include reply source as $kind. โ€” you gave the include option of reply() an alternative it does not recognize. the valid choices are "NO", "INLINE", and "ATTACH". thrown by reply() ๐Ÿ’Œ
  • Error: cannot read message from a $source. โ€” thrown by read() ๐Ÿ“ญ
  • Error: class $package does not implement method $method. โ€” okay this one is a fatal error, so listen up: that specific $package (or one of its superclasses) genuinely does not implement this method where it's supposed to. the tea here is that some other related classes do implement it, and this class at hand justโ€ฆ doesn't ๐Ÿ˜ญ so you should probably investigate this, and probably inform the author of the package. thrown by notImplemented() ๐Ÿ‘‘
  • Error: coercion starts with some object, not '$type'. โ€” thrown by coerce() ๐Ÿ’€
  • Error: method bounce requires To, Cc, or Bcc. โ€” bounce() forwards a received message off to someone else without modification, so you have to tell it where it's going. and if you're feeling the urge to not specify any destination at all? you're probably looking for reply(). and if you want to actually change the content, use forward(). thrown by bounce() ๐Ÿ€
  • Error: method forwardAttach requires a preamble. โ€” thrown by forwardAttach() ๐ŸŽ€
  • Error: method forwardEncapsulate requires a preamble. โ€” thrown by forwardEncapsulate() ๐ŸŒธ
  • Error: method forwardNo requires a To. โ€” thrown by forwardNo() ๐Ÿ“ฎ
  • Error: method forwardNo requires a body. โ€” thrown by forwardNo() ๐Ÿ“
  • Error: no rebuild rule $name defined. โ€” thrown by rebuild() ๐Ÿ”ง
  • Error: only build() Mail::Message's; they are not in a folder yet. โ€” so you want to construct a message that's gonna live in some kind of folder, right? that's a two-step situation, bestie. step one: create a normal Mail::Message. step two: add it to the folder. and during that Mail::Box::addMessage() process, the message gets coerce()-d into the right message type, picking up storage information and all that good stuff along the way. thrown by build() ๐Ÿงš
  • Error: please install Email::Simple. โ€” thrown by coerce() ๐Ÿ“ฆ
  • Error: please install MIME::Entity. โ€” thrown by coerce() ๐Ÿ“ฆ
  • Error: please install Mail::Internet. โ€” thrown by coerce() ๐Ÿ“ฆ
  • Error: select parts via '$what'? โ€” thrown by parts() ๐Ÿคจ
  • Warning: skipped unknown key '$key' in build. โ€” thrown by build() โš ๏ธ
  • Error: unable to read delayed body for $msgid. โ€” thrown by loadBody() ๐Ÿ˜ต
  • Error: unable to read delayed head for $msgid. โ€” thrown by loadBody() ๐Ÿ˜ต

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

this module is part of Mail-Box version 4.02, built on April 10, 2026 ๐Ÿ’–

the website is: http://perl.overmeer.net/CPAN/ ๐ŸŒˆ


๐Ÿ“œ LICENSE ๐Ÿ“œ

for contributors, see the file ChangeLog โœ๏ธ

this software is copyright (c) 2001-2026 by Mark Overmeer ๐Ÿ‘‘

it's free software, bestie โ€” you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself ๐Ÿซถ


and that's a wrap on this page, angel ๐Ÿ’… it was built off perl v5.40.1 and dated 2026-05-09, so yeah โ€” consider this manual your little timestamped love letter from the Mail::Message team. go forth and slay those messages โœจ๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from