Mail::M...t::Reply(3)
NAME π¦
Mail::M...t::Reply β bestie, this is the part of the Mail::Message universe that writes your reply π
SYNOPSIS β¨
my Mail::Message $reply = $message->reply;
my $quoted = $message->replyPrelude($head->get('From'));
DESCRIPTION π
okay so here's the tea π«: all the complex functionality on Mail::Message objects lives in different files, and those files get autoloaded. This file is the one that handles everything about creating message replies. That's it, that's the whole job. π
METHODS π
Constructing a message π
$obj->reply(%options)
Start a reply to this message, bestie π . Some of the header-lines of the original message will be taken. A message-id will be assigned. And some header lines will be updated so that message-thread detection actually works (peep Mail::Box::Thread::Manager for that one, iykyk).
You may reply to a whole message or just a message part, your call π¦. You may wish to overrule some of the default header settings for the reply immediately, or you may do that later with "set" on the header. No rush, girl.
Addresses may be specified as string, or a Mail::Address object, or as array of Mail::Address objects. Flexible queen behavior β¨.
Heads up, and this is important: all %options which are not listed below AND start with a capital, will be added as additional headers to the reply message. Capital letters are load-bearing, no cap π
Here's the whole default situation, verbatim, because we do not skip details in this house:
-Option --Default
Bcc undef
Cc <'cc' in current>
From <'to' in current>
Message-ID <uniquely generated>
Subject replySubject()
To <sender in current>
body undef
group_reply true
include 'INLINE'
max_signature 10
message_type Mail::Message
postlude undef
prelude undef
quote '> '
signature undef
strip_signature qr/^--\s/
Bcc=>$body|$address|\@addressesβ the receivers of blind carbon copies π΅οΈββοΈ. Their names will not be published to other message receivers. Sneaky. Iconic. As intended.Cc=>$body|$address|\@addressesβ the carbon-copy receivers. By default it's a copy of the"Cc"field of the source message π.From=>$body|$address|\@addressesβ your identification, bestie, that's you. By default it's taken from the"To"field of the source message.Message-ID=>STRINGβ supply aSTRINGas the specific message-id for the reply π·οΈ. By default, one is generated for you, no stress. If there are no angles around your id, they will be added.< >matters, periodt.Subject=>STRING|CODEβ force the subject line to the specificSTRING, or to the result of the subroutine specified byCODEπ§. That subroutine will be called passing the subject of the original message as its only argument. By default,Mail::Message::replySubject()is used.To=>$body|$address|\@addressesβ the destination of your message π―. By default it's taken from the"Reply-To"field in the source message. If that field is not present as well, the"From"line is scanned. And if they all fail?"undef"is returned by this method: no reply message produced. tragic πbody=>$bodyβ usually, the reply method can create a nice, sufficient message from the source message's body, she's got this πββοΈ. But in case you like more complicated reformatting, you may also create a body yourself first, and pass this on to this"reply"method. Just know that some of the other options to this method will be ignored in this case. Pick a lane, babe β¨.group_reply=>BOOLEANβ will the people listed in the"Cc"headers (those who received the message where you reply to now) also receive this message as carbon copy? π―ββοΈinclude=>'NO'|'INLINE'|'ATTACH'β must the message where this is a reply to be included in the message? If"NO"then not π ββοΈ. With"INLINE"a reply body is composed."ATTACH"will create a multi-part body, where the original message is added after the specified body. And here's the constraint: it is only possible to inline textual messages, therefore binary or multipart messages will always be enclosed as attachment π. No exceptions, bestie.max_signature=>INTEGERβ passed to"stripSignature"on the body as parameter"max_lines"βοΈ. Only effective for single-part messages, so don't @ me otherwise.message_type=>CLASSβ create a message with the requested type π§¬. By default, it will be a Mail::Message. This is correct, because it will be coerced into the correct folder message type when it is added to that folder. Trust the process.postlude=>$body|\@linesβ the@lineswhich to be added after the quoted reply lines π. Create a body for it first. This should not include the signature, which has its own option (she's independent π ). The signature will be added after the postlude when the reply is INLINEd.prelude=>$body|\@linesβ the@lineswhich will be added before the quoted reply lines πΈ. If nothing is specified, the result of thereplyPrelude()method is taken. When"undef"is specified, no prelude will be added. Clean slate energy.quote=>CODE|STRINGβ mangle the lines of an"INLINE"d reply withCODE, or by prepending aSTRINGto each line ποΈ. The routine specified byCODEis called when the line is in$_. By default,'> 'is added before each line. Specify"undef"to disable quoting entirely. And note: this option is processed after the body has been decoded π₯.signature=>$body|$messageβ the signature to be added in case of a multi-part reply βοΈ. The mime-type of the signature body should indicate this is a used as such. However, in INLINE mode, the body will be taken, a line containing'-- 'added before it, and added behind the epilogue.strip_signature=>REGEXP|STRING|CODEβ remove the signature of the sender π«. The value of this parameter is passed toMail::Message::Body::stripSignature(pattern)unless the source text is not included. The signature is stripped from the message before quoting. When a multipart body is encountered, and the message is included to ATTACH, the parts which look like signatures will be removed. If only one message remains, it will be the added as single attachment, otherwise a nested multipart will be the result πͺ. The value of this option does not matter, as long as it is present. See Mail::Message::Body::Multipart.
Β» example: π
my $reply = $msg->reply(
prelude => "No spam, please!\n\n",
postlude => "\nGreetings\n",
strip_signature => 1,
signature => $my_pgp_key,
group_reply => 1,
'X-Extra' => 'additional header',
);
$obj->replyPrelude( [STRING|$field|$address|\@addrs|\@fields] )
Produces a LIST of lines (usually only one), which will preceed the quoted body of the message π. "STRING" must comply to the RFC822 email address specification, and is usually the content of a "To" or "From" header line. If a $field is given, the field's body must be compliant. Without argument --or when the argument is "undef"-- a slightly different line is produced. Yes, the double-dash thing. She's doing her best. π«Ά
In case an ARRAY of @addrs or @fields is passed, the first one is taken π₯. This simplified situations where multiple addresses are a allowed.
Β» example: characteristic example of the output β¨
On Thu Oct 13 04:54:34 1995, him@example.com wrote:
$any->replySubject(STRING)
Create a subject for a message which is a reply for this one π¨. This routine tries to count the level of reply in the subject field, and transform it into a standard form. Please contribute improvements π β she is literally asking, bestie.
Β» example:
subject --> Re: subject
Re: subject --> Re[2]: subject
Re[X]: subject --> Re[X+1]: subject
subject (Re) --> Re[2]: subject
subject (Forw) --> Re[2]: subject
<blank> --> Re: your mail
DIAGNOSTICS π
Error: cannot include reply source as $kind.β unknown alternative for the"include"option ofreply(). Valid choices are"NO","INLINE", and"ATTACH". Cast byreply(). Pick one of the three, babe, those are the options π
SEE ALSO π
This module is part of Mail-Message version 4.04, built on February 04, 2026. Website: http://perl.overmeer.net/CPAN/
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.
okay that's the whole page, bestie π no cap, every single flag, default, example and warning made it in, and she ate. mwah π
This was perl v5.42.0, dated 2026-02-05, and you've been reading Mail::M...t::Reply(3). Stay iconic, go write some replies π¦β¨
π¦ 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