Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Zend_Mail_Protocol_Abstract
Provides low-level methods for concrete adapters to communicate with a remote mail server and track requests and responses.
EOL = '\r\n'
Mail default EOL string
Details TIMEOUT_CONNECTION = '30'
Default timeout in seconds for initiating session
Details MAXIMUM_LOG = '64'
Maximum of the transaction log
Detailsstring $_host = ''Hostname or IP address of remote server
Detailsarray $_log = 'array'Log of mail requests and server responses for a session
Detailsinteger $_port = ''Port number of connection
Detailsstring $_request = ''Last request sent to server
Detailsarray $_response = ''Array of server responses to last request
Detailsresource $_socket = ''Socket connection resource
Detailsresource $_template = '%d%s'String template for parsing server responses using sscanf (default: 3 digit code and response string)
DetailsZend_Validate $_validHost = ''Instance of Zend_Validate to check hostnames
Details__construct(
string $host
=
127.0.0.1, integer $port
=
null
)
:
voidConstructor.
Details__destruct(
)
:
voidClass destructor to cleanup open resources
Details_addLog(
string $value
)
:
voidAdd the transaction log
Details_connect(
string $remote
)
:
booleanConnect 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'
Details_disconnect(
)
:
voidDisconnect from remote host and free resource
Details_expect(
string|array $code, $timeout
=
null
)
:
stringParse 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.
Details_receive(
$timeout
=
null
)
:
stringGet a line from the stream.
Details_send(
string $request
)
:
integer|booleanSend the given request followed by a LINEEND to the server.
Detailsconnect(
)
:
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.
DetailsgetLog(
)
:
stringRetrieve the transaction log
DetailsgetRequest(
)
:
stringRetrieve the last client request
DetailsgetResponse(
)
:
arrayRetrieve the last server response
DetailsresetLog(
)
:
voidReset the transaction log
Details