Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: c:/www/apache/doc2//pear/Net/SMTP.php
PEAR 2000/12/03 -

Net_SMTP

PEAR
   |
  +-- Net_SMTP

Provides an implementation of the SMTP protocol using PEAR's

 

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_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

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.
int

$code

The most recent reply code
array

$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 defaultswith parameters that are passed in.

Parameter
string $host = >>null,<<
server to connect to.
string $port = >>null,<<
port to connect to.
string $localhost = >>null<<
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
userid to authenticate as.
string $pwd
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
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
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
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
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
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
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
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
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
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 theresponse in the array passed by reference as the secondargument.

Parameter
int $code
response code we are expecting.
array &$arguments
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'<<

The server to connect to.


$port

private integer $port

>>25<<

The port to connect to.


$localhost

private string $localhost

>>'localhost'<<

The value to give when sending EHLO or HELO.


$socket

private unknown $socket

>><<

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


$code

private int $code

>><<

The most recent reply code


$esmtp

private array $esmtp

>><<

Stores detected features of the SMTP server.



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta