Mail::...::SMTP(3pm)
β¨ Mail::SendEasy::SMTP π
okay bestie, so this page is the manual for Mail::SendEasy::SMTP β that's the Mail::...::SMTP(3pm) perl doc, and she's a whole mood. no preamble, let's GO π«Ά
πΈ NAME πΈ
Mail::SendEasy::SMTP β she handles all the talking-to-the-SMTP-server business, and she does it with zero dependencies. not a single one. icon behavior fr fr π
π¦ DESCRIPTION π¦
So basically this module is the one who does the whole communication with the SMTP server. that's her job, that's her moment, that's her main character energy.
She has no dependencies β none, nada, zero β and she supports authentication. no cap. π
π USAGE π
here's the vibe, literally copy this energy:
use Mail::SendEasy ;
$smtp = Mail::SendEasy::SMTP->new( 'domain.foo' , 25 , 120 ) ;
if ( !$smtp->auth ) { warn($smtp->last_response_line) ;}
if ( $smtp->MAIL("FROM:<$mail{from}>") !~ /^2/ ) { warn($smtp->last_response_line) ;}
if ( $smtp->RCPT("TO:<$to>") !~ /^2/ ) { warn($smtp->last_response_line) ;}
if ( $smtp->RCPT("TO:<$to>") !~ /^2/ ) { warn($smtp->last_response_line) ;}
if ( $smtp->DATA =~ /^3/ ) {
$smtp->print("To: foo@foo") ;
$smtp->print("Subject: test") ;
$smtp->print("\n") ;
$smtp->print("This is a sample MSG!") ;
if ( $smtp->DATAEND !~ /^2/ ) { warn($smtp->last_response_line) ;}
}
$smtp->close ;
likeβ¦ the way she checks every response against /^2/ and /^3/ and warns you if it's giving anything else?? obsessed. π§
π METHODS π
π new ($host , $port , $timeout , $user , $pass)
Makes the SMTP object and connects to the server. that's it, that's the birth of the whole operation. slay. β¨
π connect
Connects to the server. justβ¦ connects. hello?? hi server bestie π«Ά
π auth_types
The authentication types that the SMTP server supports. she tells you what she's willing to do π
π auth($user , $pass)
Does the authentication. you pass the $user and the $pass, she does the rest. periodt. π₯
π print (data)
Sends data to the socket connection. it's giving "write it and send it" π
π cmd (CMD , @MORE)
Sends a command to the server β you give her the CMD plus any @MORE you wanna tack on. π
π response
Returns the code response.
and listen β if wantarray, she returns an ARRAY with the response lines instead. context matters, bestie π
π last_response
Returns an ARRAY with the response lines. (yes, the last ones β the freshest ones π)
π last_response_msg
The last response text. just the words, no code. π¬
π last_response_line
The last response line β code AND text, together, the full package. π
π close
QUIT and close the connection. say bye, hang up, log off. the end of an era πβ¨
π AUTHOR π
Graciliano M. P. <gm@virtuasites.com.br>
(ty for your service king π)
π COPYRIGHT π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
like, free free. go off. π
and that's the whole page, bestie!! π¦ this version dropped as perl v5.32.0 on 2021-01-05, so yeah β vintage but still ate π
π mwah, go send some emails πΈ
π¦ where this page comes from
- debian bookworm: libmail-sendeasy-perl 1.2-2.1
- debian trixie: libmail-sendeasy-perl 1.2-2.1
- ubuntu jammy: libmail-sendeasy-perl 1.2-2.1
- ubuntu noble: libmail-sendeasy-perl 1.2-2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms