Mail::T...rt::Send(3)
๐ NAME
okay bestie, welcome to Mail::Transport::Send โ it's a Perl module and its whole entire job is: send a message. that's it. that's the vibe. ๐
this page is from the User Contributed Perl Documentation set, section 3 of the manual, and yes we're about to go through ALL of it together, no skimming, no skipping, periodt. ๐
๐ณ INHERITANCE
the family tree goes like this, and yes it's giving dynasty:
Mail::Transport::Send
is a Mail::Transport
is a Mail::Reporter
Mail::Transport::Send is extended by
Mail::Transport::Exim
Mail::Transport::Mailx
Mail::Transport::Qmail
Mail::Transport::SMTP
Mail::Transport::Sendmail
so like โ it is a Mail::Transport and is a Mail::Reporter, and those five other modules above all extend it. the nepo babies are the whole point here, iykyk. ๐
โจ SYNOPSIS
here's the whole entire flex, look:
my $message = Mail::Message->new(...);
# Some extensions implement sending:
$message->send;
$message->send(via => 'sendmail');
my $sender = Mail::Transport::SMTP->new(...);
$sender->send($message);
literally that's it. build a message, yeet it. ๐ฆ
๐ธ DESCRIPTION
so the whole point of this module: it sends a message to the destinations as specified in the header. that's the assignment. ๐ซถ
and here's the slay part โ Mail::Transport::Send is capable of autodetecting which of the following modules actually work on your system. so you can just call send with no via options and get your message transported. no thinking required, bestie. ๐
Mail::Transport::Sendmailโ usessendmailto process and deliver the mail. this needs thesendmailprogram installed on your system. and ngl, whether this is an original sendmail or a replacement from Postfix does matter. not me warning you in advance. ๐Mail::Transport::Eximโ useseximto distribute the message. simple. clean. iconic.Mail::Transport::Qmailโ usesqmail-injectto distribute the message. okay go off.Mail::Transport::SMTPโ here, Perl is handling mail transport on its own. this is less desired but more portable than sending with sendmail or qmail. the advantage is that this sender is environment independent and easier to configure. however โ and this is the part you need to hear โ there is no daemon involved, which means your program will just... wait until the message is delivered. and the message is lost when your program is interrupted during delivery (which may take hours to complete). ๐ญ so like, main character energy but with consequences. be careful.Mail::Transport::Mailxโ uses the externalmail,mailx, orMailprograms to send the message. usually, the result is poor, because some versions of these programs do not support MIME headers. besides, these programs are known to have exploitable security breaches. not the vibe, lowkey a red flag. ๐
Extends "DESCRIPTION" in Mail::Transport.
๐ ๏ธ METHODS
Extends "METHODS" in Mail::Transport.
๐ Constructors
Extends "Constructors" in Mail::Transport.
$class->new(%options)
Inherited, see "Constructors" in Mail::Reporter.
here's the whole entire options menu, no substitutions:
-Option --Defined in --Default
executable Mail::Transport undef
hostname Mail::Transport 'localhost'
interval Mail::Transport 30
password Mail::Transport undef
port Mail::Transport undef
proxy Mail::Transport undef
retry Mail::Transport <unlimited>
timeout Mail::Transport 120
username Mail::Transport undef
via Mail::Transport 'sendmail'
executable => $filehostname => $host|\@hostsinterval => $spanpassword => $passwordport => $portproxy => $pathretry => $count|undeftimeout => $spanusername => $usernamevia => CLASS|$name
(no descriptions given for these, bestie โ the original is being mysterious and honestly, respect. ๐ค)
๐ Attributes
Extends "Attributes" in Mail::Transport.
๐ฎ Sending mail
$obj->destinations( $message, [$address|\@addresses] )
figures out the destination for this message. and here's the rules:
if a valid $address is defined, it's used to overrule the addresses within the message. if the $address is undef, it gets ignored (rude but okay). it may also be an ARRAY of @addresses. โจ
if no $address is specified, the message gets scanned for resent groups (see Mail::Message::Head::Complete::resentGroups()). the addresses found in the first (which is the latest added) group are used. and if no resent groups are found at all? then the normal To, Cc, and Bcc lines are taken. the way that fallback chain just works. ๐
$obj->putContent($message, $fh, %options)
prints the content of the $message to the $fh. ๐จ๏ธ
heads up: the content might not end with a new-line. see Mail::Message::endsOnNewline().
-Option --Default
body_only false
undisclosed false
body_only => BOOLEANโ print only the body of the message, not the whole thing. just the goods.undisclosed => BOOLEANโ do not print theBccandResent-Bcclines. the default isfalse, which means that they are not printed. (yes, read that twice, we said what we said. ๐)
$obj->send($message, %options)
the main event. ๐ค transmits the $message, which may be anything that can be coerced into a Mail::Message โ so that includes Mail::Internet and MIME::Entity messages too. flexible queen. it returns true when the transmission was successfully completed. โ
-Option --Default
interval new(interval)
retry new(retry)
to undef
interval => SECONDSretry => INTEGERto => STRINGโ overrules the destination(s) of the message, which by default is taken from the(Resent-)To,(Resent-)Cc, and(Resent-)Bcc.
$obj->trySend($message, %options)
tries to send the message. it returns true if it worked, and false in case some problems were detected. also, $? contains the exit status of the command which was started. so like, you always know what happened. ๐ต๏ธโโ๏ธ
๐ Server connection
Extends "Server connection" in Mail::Transport.
$obj->findBinary( $name, [@directories] )โ inherited, see "Server connection" in Mail::Transport.$obj->remoteHost()โ inherited, see "Server connection" in Mail::Transport.$obj->retry()โ inherited, see "Server connection" in Mail::Transport.
๐จ Error handling
Extends "Error handling" in Mail::Transport.
$obj->AUTOLOAD()โ inherited, see "Error handling" in Mail::Reporter.$obj->notImplemented()โ inherited, see "Error handling" in Mail::Reporter.
๐งน Cleanup
Extends "Cleanup" in Mail::Transport.
$obj->DESTROY()โ inherited, see "Cleanup" in Mail::Reporter.
๐ DIAGNOSTICS
listen up, this is the part where things go wrong and we learn from it. ๐
Error: class $package does not implement method $method.
Fatal error. the specific $package (or one of its superclasses) does not implement this method where it should. this message means that some other related classes do implement this method, however the class at hand does not. probably you should investigate this and probably inform the author of the package. Cast by notImplemented().
Warning: message has no destination.
it was not possible to figure-out where the message is intended to go to. ๐ญ Cast by destinations().
Warning: resent group does not specify a destination.
the message which is sent is the result of a bounce (for instance created with Mail::Message::bounce()), and therefore starts with a Received header field. with the bounce, the new destination(s) of the message are given, which should be included as Resent-To, Resent-Cc, and Resent-Bcc. ๐ฏ
the To, Cc, and Bcc header information is only used if no Received was found. that seems to be the best explanation of the RFC. ๐ซก
as an alternative, you may also specify the to option to some of the senders (for instance Mail::Transport::SMTP::send(to) to overrule any information found in the message itself about the destination. Cast by destinations().
Error: transporters of type $class cannot send.
the Mail::Transport object of the specified type can not send messages, but only receive messages. so like, wrong girl for the job. Cast by trySend().
๐ SEE ALSO
this module is part of Mail-Transport version 4.01, built on December 13, 2025. ๐ Website: http://perl.overmeer.net/CPAN/
๐ LICENSE
for contributors see file ChangeLog. ๐
this software is copyright (c) 2001-2025 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, we ate and left no crumbs ๐ โ this was Mail::Transport::Send(3) from the User Contributed Perl Documentation, rendered with perl v5.42.0 on 2026-01-17. mwah, go send some mail. ๐โจ๐ฆ
๐ฆ where this page comes from
- fedora 44: perl-Mail-Transport 4.01-2.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