Mail::M...eEntity(3)
π Mail::Message::Convert::MimeEntity β bestie edition β¨
okay so the manual name is Mail::M...eEntity(3) (yes she's got an ellipsis in her name, iconic of her honestly) and she's here to translate Mail::Message to MIME::Entity vv. that's the whole vibe. converting between two message worlds. no cap.
πΈ INHERITANCE
the family tree, and she did NOT come from nowhere:
Mail::Message::Convert::MimeEntity
is a Mail::Message::Convert
is a Mail::Reporter
so she inherits from Mail::Message::Convert, which inherits from Mail::Reporter. generational wealth tbh π
β¨ SYNOPSIS
here's the whole serve, copy it exactly bestie:
use Mail::Message::Convert::MimeEntity;
my $convert = Mail::Message::Convert::MimeEntity->new;
my Mail::Message $msg = Mail::Message->new;
my MIME::Entity $entity = $convert->export($msg);
my MIME::Entity $entity = MIME::Entity->new;
my Mail::Message $msg = $convert->from($entity);
use Mail::Box::Manager;
my $mgr = Mail::Box::Manager->new;
my $folder = $mgr->open(folder => 'Outbox');
$folder->addMessage($entity);
like. she takes your Mail::Message, hands you back a MIME::Entity, and does the reverse too. then you can yeet that entity straight into a folder with Mail::Box::Manager. main character energy fr fr π«Ά
π¦ DESCRIPTION
so MIME::Entity is that girl who takes a Mail::Internet message and levels it up with multiparts and extra methods. slay.
meanwhile Mail::Message objects are way more flexible about how the message parts get stored β they keep separate header and body objects instead of mashing it all together. different philosophies, both valid, we don't pit them against each other π
also this section extends "DESCRIPTION" in Mail::Message::Convert, so peek at that one too if you wanna go deeper.
π METHODS
extends "METHODS" in Mail::Message::Convert. yes she's built different.
π₯ Constructors
extends "Constructors" in Mail::Message::Convert.
$class->new(%options)β inherited, so go read "METHODS" inMail::Message::Convertfor the deets.
π Attributes
extends "Attributes" in Mail::Message::Convert.
π Converting
extends "Converting" in Mail::Message::Convert.
$obj->export( $message, [$parser] )β she hands you back a brand newMIME::Entitymessage object built from the info in$message, which has to be aMail::Messageobject.
now listen β you can pass in your own $parser if you want, which is a MIME::Parser object, and that's how you change the parser flags. no $parser? no problem, she makes one for you with all the default settings. queen of backup plans π
if you pass undef where a $message should be, you get back an empty list. and if the parsing failes β yes that's the original spelling, we're keeping it, character for character β then MIME::Parser throws an exception. so like. be ready for that.
Β» example:
my $convert = Mail::Message::Convert::MimeEntity->new;
my Mail::Message $msg = Mail::Message->new;
my MIME::Entity $copy = $convert->export($msg);
$obj->from($mime_object)β the reverse serve. gives you a newMail::Messageobject built from the info in theMIME::Entityyou specified. if the conversion fails,undefcomes back. and if you passundefin place of an OBJECT, you get an empty list. (she's consistent about the undef thing, we love a girl with rules π)
Β» example:
my $convert = Mail::Message::Convert::MimeEntity->new;
my MIME::Entity $msg = MIME::Entity->new;
my Mail::Message $copy = $convert->from($msg);
$obj->selectedFields($head)β inherited, go see "Converting" inMail::Message::Convert.
π Error handling
extends "Error handling" in Mail::Message::Convert.
$obj->AUTOLOAD()β inherited, see "Error handling" inMail::Reporter.$obj->notImplemented()β inherited, see "Error handling" inMail::Reporter.
π§ Cleanup
extends "Cleanup" in Mail::Message::Convert.
$obj->DESTROY()β inherited, see "Cleanup" inMail::Reporter.
π DIAGNOSTICS
the error messages, in all their dramatic glory:
- Error: class $package does not implement method $method. fatal error bestie π the specific
$packageβ or one of its superclasses β does not implement this method where it should. what this means: some other related classes do implement it, but the class you're holding does not. so probably go investigate, and probably inform the author of the package. cast bynotImplemented(). - Error: converting from MIME::Entity but got a $class. cast by
from(). - Error: export message must be a Mail::Message object, but is $what. cast by
export().
π₯ SEE ALSO
this module is part of Mail-Message version 4.04, built on February 04, 2026. website: http://perl.overmeer.net/CPAN/ β go say hi π
π LICENSE
for contributors, see file ChangeLog.
this software is copyright (c) 2001-2026 by Mark Overmeer.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt.
and that's the whole page, bestie β¨ this doc was rendered by perl v5.42.0 on 2026-02-05, under the manual name Mail::M...eEntity(3) β go forth and convert those messages, i'm obsessed with you ππ¦π
π¦ where this page comes from
- fedora 44: perl-Mail-Message 4.04-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms