Net::S...ntained(3pm)
π Net::S...ntained β the Perl manual page, but make it cute π
okay bestie, so this is a User Contributed Perl Documentation page, and the module's full name is Net::SMTP::TLS::ButMaintained. Long name, big energy, and it is DEPRECATED β the page literally says use Net::SMTPS instead. We'll get to that. Sit down, grab a strawberry π, and let's go.
β¨ NAME β¨
Net::SMTP::TLS::ButMaintained β an SMTP client that supports TLS and AUTH. And yes, the official subtitle is: DEPRECATED, use Net::SMTPS instead. She's retiring, bestie, but she still serves π
πΈ VERSION πΈ
version 0.24
π SYNOPSIS π
use Net::SMTP::TLS::ButMaintained;
my $mailer = Net::SMTP::TLS::ButMaintained->new(
'your.mail.host',
Hello => 'some.host.name',
Port => 25, #redundant
User => 'emailguy',
Password=> 's3cr3t');
$mailer->mail('emailguy@your.mail.host');
$mailer->to('someonecool@somewhere.else');
$mailer->data;
$mailer->datasend("Sent thru TLS!");
$mailer->dataend;
$mailer->quit;
like. that's the whole vibe. construct, mail, to, data, datasend, dataend, quit. iconic honestly π¦
π DESCRIPTION π
DEPRECATED! Please use Net::SMTPS instead. fr fr, this is the loudest part of the whole page and I'm not gonna soften it π
Net::SMTP::TLS::ButMaintained is forked from Net::SMTP::TLS. Blame "Evan Carroll" for the idea. :) (their words, not mine, I'm just the messenger π«Ά)
So what is she? Net::SMTP::TLS::ButMaintained is a TLS and AUTH capable SMTP client, and the interface is gonna feel so familiar if you've used Net::SMTP. That said β she implements a subset of the methods that module provides. Definitely not (yet) a complete mirror image of that API. No cap. She's doing her best and her best is a subset π
The methods she does support are the ones used in the example up there. Most of them are pretty self explanatory, ngl, but if you're unclear, go read the perldoc for Net::SMTP. It's giving "read the other manual, bestie."
Now, the differences in the methods provided, because this is the important part:
- The
mailmethod does not take the options list thatNet::SMTPtakes. - The
tomethod also does not take options, and it is the only method available to set the recipient β unlike the many synonymsNet::SMTPhands you. One method, one job, no drama π - The constructor takes a limited number of
Net::SMTP's parameters. The constructor forNet::SMTP::TLS::ButMaintainedtakes the following β and heads up, this is in addition to the hostname of the mail server, which must be the first parameter and is not explicitly named:NoTLSβ in the unlikely event that you need to use this class to do non-TLS SMTP (and honestly you ought to be usingNet::SMTPitself for that...), this turns off TLS when you supply it with a true value. Warning bestie: this will most often cause an error related to authentication when used on a server that requires TLS β οΈHelloβ hostname used in theEHLOcommandPortβ port to connect to the SMTP service (defaults to25)Timeoutβ Timeout for initial socket connection (defaults to5, passed directly toIO::Socket::INET)Userβ username for SMTP AUTHPasswordβ password for SMTP AUTH
π TLS and AUTHentication π
During construction of a Net::SMTP::TLS::ButMaintained instance, the full login process will occur. Like, immediately. No waiting around. Here's the order of operations, bestie:
- Send
EHLOto the server. - Initiate a TLS session through
STARTTLS. - Once that's done, the module attempts to log in using the credentials supplied by the constructor β if such credentials have been supplied. No creds, no login attempt, that's the deal.
The AUTH method depends on the features the server returns after the EHLO command. Based on that, CRAM-MD5 will be used if available, followed by LOGIN, followed by PLAIN. Priority order, she's decisive π
please note thatLOGINis the only method of authentication that has been tested. TheCRAM-MD5andPLAINlogin functionality was taken directly from the script mentioned in the acknowledgements section β however, those have not been tested personally. So like... fair warning π«£
π ERROR HANDLING π
This module will croak in the event of an SMTP error. It does not do gentle. It does not do subtle. It croaks.
Should you wish to handle this gracefully in your application, you may wrap your mail transmission in an eval {} block and check $@ afterward. That's the move. Protect your vibe, protect your app π‘οΈ
π ACKNOWLEDGEMENTS π
This code was blatantly plagiarized from Michal Ludvig's smtp-client.pl script. Their words!! See <http://www.logix.cz/michal/devel/smtp> for his excellent work. Genuinely excellent work, we stan π
Improvements courtesy of Tomek Zielinski β thank you for your service π«Ά
π AUTHORS π
- Alexander Christian Westholm
<awestholm at verizon dawt net> - Fayland Lam
<fayland@gmail.com>
β COPYRIGHT AND LICENSE β
This software is copyright (c) 2011 by Alexander Christian Westholm, Fayland Lam.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie!! π this one came from perl v5.26.2, dated 2018-08-27, and it's part of the User Contributed Perl Documentation. now go use Net::SMTPS instead, okay? ily, bye πβ¨
π¦ where this page comes from
- debian bookworm: libnet-smtp-tls-butmaintained-perl 0.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-smtp-tls-butmaintained-perl 0.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libnet-smtp-tls-butmaintained-perl 0.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-smtp-tls-butmaintained-perl 0.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms