Mail::T...rt::SMTP(3)
๐ Mail::Transport::SMTP ๐
okay bestie, you found it ๐ this is Mail::T...rt::SMTP(3), from the User Contributed Perl Documentation, and it's literally the module that slides into the SMTP server's DMs all by itself. no middleman. let's go ๐
๐ NAME
Mail::Transport::SMTP โ transmit messages without external program
fr fr. it does the whole thing on its own ๐ฆ
๐ INHERITANCE
Mail::Transport::SMTP
is a Mail::Transport::Send
is a Mail::Transport
is a Mail::Reporter
generational wealth, honestly ๐
โจ SYNOPSIS
my $sender = Mail::Transport::SMTP->new(...);
$sender->send($message);
$message->send(via => 'smtp');
๐ธ DESCRIPTION
so this module implements transport of Mail::Message objects by negotiating to the destination host directly, using the SMTP protocol. no help from sendmail, mail, or any other programs on the local host. it's giving self-sufficient queen energy โจ
warning: you may need to install Net::SMTPS, to get TLS support. ๐
Extends "DESCRIPTION" in Mail::Transport::Send.
๐ง METHODS
Extends "METHODS" in Mail::Transport::Send.
๐ Constructors
Extends "Constructors" in Mail::Transport::Send.
$class->new(%options)โ Inherited, see "Constructors" in Mail::Reporter
here's the whole vibe check table, every option, every default, nothing skipped:
-Option --Defined in --Default
esmtp_options {}
executable Mail::Transport undef
from undef
helo <from Net::Config>
hostname Mail::Transport <from Net::Config>
interval Mail::Transport 30
password undef
port Mail::Transport 25
proxy Mail::Transport <from Net::Config>
retry Mail::Transport <unlimited>
smtp_debug false
timeout 120
username undef
via Mail::Transport 'smtp'
esmtp_options => \%optsโ[2.116]ESMTP options to pass to Net::SMTP. See the Net::SMTP documentation for full details. Options can also be passed at send time. For example:{ XVERP => 1 }๐executable => $filefrom => $addressโ lets you set a default sender$addressglobally. SeetrySend()for full details. ๐ฎhelo => $hostโ the fully qualified name of the sender's$host(that's your system, bestie) which is used for the greeting message to the receiver. If you don't specify it, Net::Config or else Net::Domain get questioned to find it. And when even those can't come up with a valid name, the name of the domain in the"From"line of the message gets assumed. ๐hostname => $host|\@hostsinterval => $spanpassword => $passwordโ the password to be used with the"username"to log in to the remote server. ๐port => $portproxy => $pathretry => $count|undefsmtp_debug => BOOLEANโ simulate transmission: the SMTP protocol output will be sent to your screen. ๐ (yes, it's fake-sending, but make it fashion)timeout => $waitโ the number of seconds to$waitfor a valid response from the server before failing. โณusername => $usernameโ use SASL authentication to contact the remote SMTP server (RFC2554). This$usernamein combination with"password"is passed as arguments to Net::SMTP methodauth. Other forms of authentication are not supported by Net::SMTP. The"username"can also be specified as an Authen::SASL object. ๐ชชvia => CLASS|$name
๐ซ Attributes
Extends "Attributes" in Mail::Transport::Send.
๐ฌ Sending mail
Extends "Sending mail" in Mail::Transport::Send.
$obj->destinations( $message, [$address|\@addresses] )โ Inherited, see "Sending mail" in Mail::Transport::Send$obj->putContent($message, $fh, %options)โ Inherited, see "Sending mail" in Mail::Transport::Send$obj->send($message, %options)โ Inherited, see "Sending mail" in Mail::Transport::Send$obj->trySend($message, %options)โ try to send the$messageonce. This may fail, in which case this method will return"false". In list context, the reason for failure can be caught: in list contexttrySendwill return a list of six values:
(success, rc, rc-text, error location, quit success, accept)
Success and quit success are booleans. The error code and -text are protocol specific codes and texts. The location tells where the problem occurred.
[3.003] the 'accept' returns the message of the dataend() instruction. Some servers may provide useful information in there, like an internal message registration id. For example, postfix may return "2.0.0 Ok: queued as 303EA380EE". You can only use this parameter when running local delivery (which is a smart choice anyway) Improves base, see "Sending mail" in Mail::Transport::Send ๐
and here's the option table for trySend:
-Option --Default
esmtp_options +{}
from < >
to []
esmtp_options => \%optsโ additional or overridden EMSTP options. Seenew(esmtp_options)๐from => $addressโ your own identification. This may be fake. If not specified, it is taken fromMail::Message::sender(), which means the content of the"Sender"field of the message or the first address of the"From"field. This defaults to"< >", which represents "no address". ๐to => $address|\@addressesโ alternative destinations. If not specified, the"To","Cc"and"Bcc"fields of the header are used. An$addressis a string or a Mail::Address object. ๐จ
๐ Server connection
Extends "Server connection" in Mail::Transport::Send.
$obj->contactAnyServer()โ creates the connection to the SMTP server. When more than one hostname was specified, the first which accepts a connection is taken. AnIO::Socket::INETobject is returned. ๐ซถ$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$obj->tryConnectTo($host, %options)โ try to establish a connection to deliver SMTP to the specified$host. The%optionsare passed to the"new"method of Net::SMTP. ๐
๐จ Error handling
Extends "Error handling" in Mail::Transport::Send.
$obj->AUTOLOAD()โ Inherited, see "Error handling" in Mail::Reporter$obj->notImplemented()โ Inherited, see "Error handling" in Mail::Reporter
๐งน Cleanup
Extends "Cleanup" in Mail::Transport::Send.
$obj->DESTROY()โ Inherited, see "Cleanup" in Mail::Reporter
๐ DIAGNOSTICS
- Error: authentication for
$hostfailed. โ Cast bycontactAnyServer() - Error: class
$packagedoes 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 bynotImplemented() - Warning: message has no destination. โ it was not possible to figure-out where the message is intended to go to. Cast by
destinations() - Notice: no addresses found to send the message to, no connection made. โ Cast by
trySend() - 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 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()
- Warning: use option
to' to overrule the destination:To' refers to a field. โ Cast bytrySend()
๐ 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.
okay that's the whole page, you ate that ๐ and just so you have the receipts: this was rendered from the page footer stamped perl v5.42.0, dated 2026-01-17, filed under Mail::T...rt::SMTP(3) ๐ slay, go send some mail bestie ๐โจ
๐ฆ 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