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.

  • version: $Id: Abstract.php 21635 2010-03-24 15:25:13Z yoshida@zend.co.jp $
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • todo: Implement proxy settings
  • abstract:
  • license: New BSD License

Located in /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 ()
 void _addLog (string $value)
 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 73)

Hostname or IP address of remote server

  • access: protected
integer $_port (line 80)

Port number of connection

  • access: protected
string $_request (line 101)

Last request sent to server

  • access: protected
array $_response (line 108)

Array of server responses to last request

  • access: protected
resource $_socket (line 94)

Socket connection resource

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

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

  • deprecated: Since 1.10.3
  • access: protected
Zend_Validate $_validHost (line 87)

Instance of Zend_Validate to check hostnames

  • access: protected
Methods
Constructor __construct (line 134)

Constructor.

  • throws: Zend_Mail_Protocol_Exception
  • access: public
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 157)

Class destructor to cleanup open resources

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

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.

  • abstract:
  • access: public
void connect ()

Redefined in descendants as:
getLog (line 198)

Retrieve the transaction log

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

Retrieve the last client request

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

Retrieve the last server response

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

Reset the transaction log

  • access: public
void resetLog ()
_addLog (line 220)

Add the transaction log

  • access: protected
void _addLog (string $value)
  • string $value: new transaction
_connect (line 238)

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'

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

Disconnect from remote host and free resource

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

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
  • throws: Zend_Mail_Protocol_Exception
  • access: protected
string _expect (string|array $code, [ $timeout = null])
  • string|array $code: One or more codes that indicate a successful response
  • $timeout
_receive (line 325)

Get a line from the stream.

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

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

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

Mail default EOL string

MAXIMUM_LOG = 64 (line 66)

Maximum of the transaction log

TIMEOUT_CONNECTION = 30 (line 61)

Default timeout in seconds for initiating session

Documentation generated on Mon, 21 Jun 2010 15:04:41 -0400 by phpDocumentor 1.4.3