Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/cch/www/pear/Net/SMTP.php
PEAR Repository -

Net_SMTP

PEAR
   |
  +-- Net_SMTP

Provides an implementation of the SMTP protocol using PEAR's
Net_Socket:: class.

 

private class Net_SMTP extends PEAR

Provides an implementation of the SMTP protocol using PEAR's
Net_Socket:: class.

AuthorsStig Bakken <ssb@fast.no>
SincePHP 4.0.2

 

Methods inherited from PEAR

pear, _pear, iserror, pear_error, getmode, getcallback, getmessage, getcode, gettype, getdebuginfo, tostring, _pear_call_destructors

Public Method Summary

void

Net_SMTP([ string $host, string $port, string $localhost ])

Constructor
mixed

connect()

Attempt to connect to the SMTP server.
mixed

disconnect()

Attempt to disconnect from the SMTP server.
mixed

auth(string $uid, string $pwd)

Attempt to do SMTP authentication.
mixed

helo(string $domain)

Send the HELO command.
mixed

mailFrom(string $reverse_path)

Send the MAIL FROM: command.
mixed

rcptTo(string $forward_path)

Send the RCPT TO: command.
mixed

data(string $data)

Send the DATA command.
mixed

send_from(string $reverse_path)

Send the SEND FROM: command.
mixed

soml_from(string $reverse_path)

Send the SOML FROM: command.
mixed

saml_from(string $reverse_path)

Send the SAML FROM: command.
mixed

rset()

Send the RSET command.
mixed

vrfy(string $string)

Send the VRFY command.
mixed

noop()

Send the NOOP command.

Private Method Summary

mixed

identifySender()

Attempt to send the EHLO command and obtain a list of ESMTP
boolean

validateResponse(int $code)

Read a response from the server and see if the response code
boolean

validateAndParseResponse(int $code, array &$arguments)

Read a response from the server and see if the response code

Fields inherited from PEAR

$_debug, $error_message_prefix, $error_prepend, $error_append, $mode, $level, $message, $debuginfo, $file, $line

Private Field Summary

string

$host

The server to connect to.
integer

$port

The port to connect to.
string

$localhost

The value to give when sending EHLO or HELO.
unknown

$socket

The socket resource being used to connect to the SMTP server.
unknown

$code

The most recent reply code
unknown

$esmtp

Stores detected features of the SMTP server.

Public Method Details

Net_SMTP

public void Net_SMTP( [ string $host, string $port, string $localhost ] )

  Constructor

Instantiates a new Net_SMTP object, overriding any defaults
with parameters that are passed in.

Parameter
string $host = >>null,<<
The server to connect to.
string $port = >>null,<<
The port to connect to.
string $localhost = >>null<<
The value to give when sending EHLO or HELO.
Returns void


connect

public mixed connect( )

  Attempt to connect to the SMTP server.

Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


disconnect

public mixed disconnect( )

  Attempt to disconnect from the SMTP server.

Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


auth

public mixed auth( string $uid, string $pwd )

  Attempt to do SMTP authentication.

Parameter
string $uid
The userid to authenticate as.
string $pwd
The password to authenticate with.
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


helo

public mixed helo( string $domain )

  Send the HELO command.

Parameter
string $domain
The domain name to say we are.
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


mailFrom

public mixed mailFrom( string $reverse_path )

  Send the MAIL FROM: command.

Parameter
string $reverse_path
The sender (reverse path) to set.
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


rcptTo

public mixed rcptTo( string $forward_path )

  Send the RCPT TO: command.

Parameter
string $forward_path
The recipient (forward path) to add.
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


data

public mixed data( string $data )

  Send the DATA command.

Parameter
string $data
The message body to send.
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


send_from

public mixed send_from( string $reverse_path )

  Send the SEND FROM: command.

Parameter
string $reverse_path
The reverse path to send.
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


soml_from

public mixed soml_from( string $reverse_path )

  Send the SOML FROM: command.

Parameter
string $reverse_path
The reverse path to send.
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


saml_from

public mixed saml_from( string $reverse_path )

  Send the SAML FROM: command.

Parameter
string $reverse_path
The reverse path to send.
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


rset

public mixed rset( )

  Send the RSET command.

Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


vrfy

public mixed vrfy( string $string )

  Send the VRFY command.

Parameter
string $string
The string to verify
Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


noop

public mixed noop( )

  Send the NOOP command.

Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


Private Method Details

identifySender

private mixed identifySender( )

  Attempt to send the EHLO command and obtain a list of ESMTP
extensions available, and failing that just send HELO.

Returns mixed

Returns a PEAR_Error with an error message on any
kind of failure, or true on success.


validateResponse

private boolean validateResponse( int $code )

  Read a response from the server and see if the response code
matches what we are expecting.

Parameter
int $code
The response code we are expecting.
Returns boolean

True if we get what we expect, false otherwise.


validateAndParseResponse

private boolean validateAndParseResponse( int $code, array &$arguments )

  Read a response from the server and see if the response code
matches what we are expecting. Also save the rest of the
response in the array passed by reference as the second
argument.

Parameter
int $code
The response code we are expecting.
array &$arguments
An array to dump the rest of the response into.
Returns boolean

True if we get what we expect, false otherwise.


Private Field Details

$host

private string $host

>>'localhost'<<


$port

private integer $port

>>25<<


$localhost

private string $localhost

>>'localhost'<<


$socket

private unknown $socket

>>unknown<<


$code

private unknown $code

>>unknown<<


$esmtp

private unknown $esmtp

>>unknown<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta