Mail::SendEasy::SMTP(3pm)

Mail::SendEasy::SMTP3pm

Handles the communication with the smtp server without dependencies.

Overview

This module will handle the communication with the SMTP server. It hasn't dependencies and supports authentication.

Usage

  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 ;

Methods

new ($host , $port , $timeout , $user , $pass)

Create the SMTP object and connects to the server.

connect

Connect to the server.

auth_types

The authentication types supported by the SMTP server.

auth($user , $pass)

Does the authentication.

print (data)

Send data to the socket connection.

cmd (CMD , @MORE)

Send a command to the server.

response

Returns the code response.

If wantarray returns an ARRAY with the response lines.

last_response

Returns an ARRAY with the response lines.

last_response_msg

The last response text.

last_response_line

The last response line (code and text).

close

QUIT and close the connection.

Releases

9 releases since Debian 5.0 (Lenny); the text changed 2 times.

  1. 5.0–6.0
  2. 7–10
  3. 11–13

Author

Graciliano M. P. <[email protected]>

From libmail-sendeasy-perl 1.2-2.1 in Debian 13 (Trixie). Parsed by carta from the page's man source.