Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes

Zend_Mail_Protocol_Abstract Class Reference

Inheritance diagram for Zend_Mail_Protocol_Abstract:
Zend_Mail_Protocol_Smtp Zend_Mail_Protocol_Smtp_Auth_Crammd5 Zend_Mail_Protocol_Smtp_Auth_Login Zend_Mail_Protocol_Smtp_Auth_Plain

Public Member Functions

 __construct ($host= '127.0.0.1', $port=null)
 __destruct ()
 connect ()
 getRequest ()
 getResponse ()
 getLog ()
 resetLog ()

Data Fields

const EOL = "\r\n"
const TIMEOUT_CONNECTION = 30

Protected Member Functions

 _connect ($remote)
 _disconnect ()
 _send ($request)
 _receive ($timeout=null)
 _expect ($code, $timeout=null)

Protected Attributes

 $_host
 $_port
 $_validHost
 $_socket
 $_request
 $_response
 $_template = '%d%s'

Detailed Description

Definition at line 50 of file Abstract.php.


Constructor & Destructor Documentation

__construct ( host = '127.0.0.1',
port = null 
)

Constructor.

Parameters:
string$hostOPTIONAL Hostname of remote connection (default: 127.0.0.1)
integer$portOPTIONAL Port number (default: null)
Exceptions:
Zend_Mail_Protocol_Exception
Returns:
void

See also:
Zend_Mail_Protocol_Exception

Definition at line 128 of file Abstract.php.

__destruct (  )

Class destructor to cleanup open resources

Returns:
void

Definition at line 151 of file Abstract.php.


Member Function Documentation

_connect ( remote ) [protected]

Connect to the server using the supplied transport and target

An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'

Parameters:
string$remoteRemote
Exceptions:
Zend_Mail_Protocol_Exception
Returns:
boolean

See also:
Zend_Mail_Protocol_Exception
Zend_Mail_Protocol_Exception

Definition at line 218 of file Abstract.php.

_disconnect (  ) [protected]

Disconnect from remote host and free resource

Returns:
void

Definition at line 254 of file Abstract.php.

_expect ( code,
timeout = null 
) [protected]

Parse server response for successful codes

Read the response from the stream and check for expected return code. Throws a Zend_Mail_Protocol_Exception if an unexpected code is returned.

Parameters:
string | array$codeOne or more codes that indicate a successful response
Exceptions:
Zend_Mail_Protocol_Exception
Returns:
string Last line of response string

See also:
Zend_Mail_Protocol_Exception

Definition at line 359 of file Abstract.php.

_receive ( timeout = null ) [protected]
_send ( request ) [protected]

Send the given request followed by a LINEEND to the server.

Parameters:
string$request
Exceptions:
Zend_Mail_Protocol_Exception
Returns:
integer|boolean Number of bytes written to remote host

See also:
Zend_Mail_Protocol_Exception
Zend_Mail_Protocol_Exception

Definition at line 269 of file Abstract.php.

connect (  ) [abstract]

Create a connection to the remote host

Concrete adapters for this class will implement their own unique connect scripts, using the _connect() method to create the socket resource.

Reimplemented in Zend_Mail_Protocol_Smtp.

getLog (  )

Retrieve the transaction log

Returns:
string

Definition at line 192 of file Abstract.php.

getRequest (  )

Retrieve the last client request

Returns:
string

Definition at line 170 of file Abstract.php.

getResponse (  )

Retrieve the last server response

Returns:
array

Definition at line 181 of file Abstract.php.

resetLog (  )

Reset the transaction log

Returns:
void

Definition at line 203 of file Abstract.php.


Field Documentation

const EOL = "\r\n"

Mail default EOL string

Definition at line 55 of file Abstract.php.

const TIMEOUT_CONNECTION = 30

Default timeout in seconds for initiating session

Definition at line 61 of file Abstract.php.


The documentation for this class was generated from the following file: