Mail::...::SMTP(3pm)

πŸ“¦
version 1.2 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ 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. πŸ”₯

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 πŸ™)


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