Abstract Class Zend_Mail_Protocol_Abstract

Description

Zend_Mail_Protocol_Abstract

Provides low-level methods for concrete adapters to communicate with a remote mail server and track requests and responses.

  • abstract:
  • license: New BSD License
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • throws: Zend_Mail_Protocol_Exception
  • todo: Implement proxy settings

Located in /Zend/Mail/Protocol/Abstract.php (line 50)


	
			
Direct descendents
Class Description
 class Zend_Mail_Protocol_Smtp Smtp implementation of Zend_Mail_Protocol_Abstract
Class Constant Summary
 EOL = "\r\n"
Variable Summary
 string $_host
 integer $_port
 string $_request
 array $_response
 resource $_socket
 resource $_template
Method Summary
 void __construct ([string $host = '127.0.0.1'], [integer $port = null])
 void __destruct ()
 void connect ()
 string getLog ()
 string getRequest ()
 array getResponse ()
 void resetLog ()
 boolean _connect (string $remote)
 void _disconnect ()
 string _expect (string|array $code, [ $timeout = null])
 string _receive ([ $timeout = null])
 integer|boolean _send (string $request)
Variables
string $_host (line 68)

Hostname or IP address of remote server

  • access: protected
integer $_port (line 75)

Port number of connection

  • access: protected
string $_request (line 96)

Last request sent to server

  • access: protected
array $_response (line 103)

Array of server responses to last request

  • access: protected
resource $_socket (line 89)

Socket connection resource

  • access: protected
resource $_template = '%d%s' (line 110)

String template for parsing server responses using sscanf (default: 3 digit code and response string)

  • access: protected
Zend_Validate $_validHost (line 82)

Instance of Zend_Validate to check hostnames

  • access: protected
Methods
Constructor __construct (line 128)

Constructor.

  • access: public
  • throws: Zend_Mail_Protocol_Exception
void __construct ([string $host = '127.0.0.1'], [integer $port = null])
  • string $host: OPTIONAL Hostname of remote connection (default: 127.0.0.1)
  • integer $port: OPTIONAL Port number (default: null)

Redefined in descendants as:
Destructor __destruct (line 148)

Class destructor to cleanup open resources

  • access: public
void __destruct ()
connect (line 159)

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.

  • access: public
  • abstract:
void connect ()

Redefined in descendants as:
getLog (line 189)

Retrieve the transaction log

  • access: public
string getLog ()
getRequest (line 167)

Retrieve the last client request

  • access: public
string getRequest ()
getResponse (line 178)

Retrieve the last server response

  • access: public
array getResponse ()
resetLog (line 200)

Reset the transaction log

  • access: public
void resetLog ()
_connect (line 215)

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'

  • access: protected
  • throws: Zend_Mail_Protocol_Exception
boolean _connect (string $remote)
  • string $remote: Remote
_disconnect (line 245)

Disconnect from remote host and free resource

  • access: protected
void _disconnect ()
_expect (line 335)

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.

  • return: Last line of response string
  • access: protected
  • throws: Zend_Mail_Protocol_Exception
string _expect (string|array $code, [ $timeout = null])
  • string|array $code: One or more codes that indicate a successful response
  • $timeout
_receive (line 290)

Get a line from the stream.

  • var: Per-request timeout value if applicable
  • access: protected
  • throws: Zend_Mail_Protocol_Exception
string _receive ([ $timeout = null])
  • $timeout
_send (line 260)

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

  • return: Number of bytes written to remote host
  • access: protected
  • throws: Zend_Mail_Protocol_Exception
integer|boolean _send (string $request)
  • string $request
Class Constants
EOL = "\r\n" (line 55)

Mail default EOL string

TIMEOUT_CONNECTION = 30 (line 61)

Default timeout in seconds for initiating session

Documentation generated on Wed, 21 Feb 2007 11:45:29 -0800 by phpDocumentor 1.3.1