Net::SMTPS(3pm)

πŸ“¦
version 0.10 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Net::SMTPS πŸ’–

okay bestie, so this is Net::SMTPS β€” the manual page, perl version, and it is literally just SSL/STARTTLS support for Net::SMTP. that's the whole vibe. securing your mail, slaying. πŸ’…


✨ SYNOPSYS ✨

use Net::SMTPS;

my $ssl = 'starttls';   # 'ssl' / 'starttls' / undef

my $smtp = Net::SMTPS->new("smtp.example.com", Port => 587, doSSL => $ssl);

like, that's it. that's the whole entrance. gorgeous. πŸ¦‹


🌸 DESCRIPTION 🌸

so this module is a wrapper for Net::SMTP, and what it does is enable over-SSL / STARTTLS support. that's the assignment and it ate. ✨

it inherits most of all the methods from Net::SMTP(2.X) β€” so basically you get all the friendly options that came bundled with Net::SMTP, no cap, they're all yours. 🫢

you control the SSL usage through the options of the new() constructor method. the switch for that is the 'doSSL' option. and if you're a details girlie and want to control the detailed SSL settings, you can set the SSL_* options, which are brought in from IO::Socket::SSL. pls go read the document of IO::Socket::SSL for all the deets on those, i'm not gonna lie to you about them. 🌈

there's just one method difference from Net::SMTP: with this one you can select the SMTP AUTH mechanism as the third option of the auth() method. iconique. πŸ‘‘

and okay, real talk moment β€” as of Version 3.10 of Net::SMTP(libnet), it includes SSL/STARTTLS capabilities, so this wrapper module's significance is... disappareing. (their typo, not mine, i'm keeping it, periodt 😭). so like. it's giving legacy bestie. but we still love her. πŸ’œ


πŸŽ€ CONSTRUCTOR πŸŽ€

  • new ( [ HOST ] [, OPTIONS ] ) β€” a few options added to Net::SMTP(2.X). πŸ’–
    • doSSL { "ssl" | "starttls" | undef } β€” to specify SSL connection type. "ssl" makes the connection wrapped with SSL, and "starttls" uses the SMTP command "STARTTLS". pick your fighter. ✨

πŸ¦‹ METHODS πŸ¦‹

most of all methods of Net::SMTP are inherited as is, except for auth(). so like, don't come for the others, they're untouched. 🌸

  • auth ( USERNAME, PASSWORD [, AUTHMETHOD]) β€” attempts SASL authentication through the Authen::SASL module. AUTHMETHOD is your required method of authentication, like 'CRAM-MD5', 'LOGIN', ... etc. and heads up bestie: if your selection does not match the server-offerred AUTH mechanism, authentication negotiation may fail. πŸ’€ so pick the right one fr fr.
  • starttls ( SSLARGS ) β€” upgrades an existing plain connection to SSL. glow up in real time. ✨

πŸ› BUGS πŸ›

okay so there's a little catch, and it's kinda sneaky: the constructor option 'Debug => (N)' (for Net::Cmd) also sets $IO::Socket::SSL::DEBUG when SSL is enabled. πŸ™ˆ two-for-one that you did not order. but good news β€” you can set 'Debug_SSL => {0-3}' separately if you want them decoupled. slay. πŸ’…

πŸ‘€ SEE ALSO πŸ‘€

  • Net::SMTP
  • IO::Socket::SSL
  • Authen::SASL

πŸ’œ AUTHOR πŸ’œ

Tomo.M <tomo at cpan.org>


Copyright (c) 2020 Tomo.M All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page bestie, we're done here. this was perl v5.36.0, dated 2022-10-16, page Net::SMTPS(3pm) β€” k thanks bye, go secure your mail, mwah πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from