Zend\Mail\Protocol\AbstractProtocol
Provides low-level methods for concrete adapters to communicate with a remote mail server and track requests and responses.
Synopsis
class AbstractProtocol
{
- // constants
- const EOL = "\r\n";
- const TIMEOUT_CONNECTION = 30;
- // members
- protected integer $maximumLog;
- protected string $host;
- protected int $port;
- protected ValidatorChain $validHost;
- protected resource $socket;
- protected string $request;
- protected array $response;
- private array $log;
- // methods
- public void __construct()
- public void __destruct()
- public void setMaximumLog()
- public int getMaximumLog()
- public abstract void connect()
- public string getRequest()
- public array getResponse()
- public string getLog()
- public void resetLog()
- protected void _addLog()
- protected bool _connect()
- protected void _disconnect()
- protected int|bool _send()
- protected string _receive()
- protected string _expect()
Hierarchy
Extended by
Tasks
Line | Task |
---|---|
19+ | Implement proxy settings |
Constants
Name | Value |
---|---|
EOL | "\r\n" |
TIMEOUT_CONNECTION | 30 |
Members
private
- $log
—
array
Log of mail requests and server responses for a session
protected
- $host
—
string
Hostname or IP address of remote server - $maximumLog
—
int
Maximum of the transaction log - $port
—
int
Port number of connection - $request
—
string
Last request sent to server - $response
—
array
Array of server responses to last request - $socket
—
resource
Socket connection resource - $validHost
—
\Zend\Validator\ValidatorChain
Instance of Zend\Validator\ValidatorChain to check hostnames
Methods
protected
- _addLog() — Add the transaction log
- _connect() — Connect to the server using the supplied transport and target
- _disconnect() — Disconnect from remote host and free resource
- _expect() — Parse server response for successful codes
- _receive() — Get a line from the stream.
- _send() — Send the given request followed by a LINEEND to the server.
public
- __construct() — Constructor.
- __destruct() — Class destructor to cleanup open resources
- connect() — Create a connection to the remote host
- getLog() — Retrieve the transaction log
- getMaximumLog() — Get the maximum log size
- getRequest() — Retrieve the last client request
- getResponse() — Retrieve the last server response
- resetLog() — Reset the transaction log
- setMaximumLog() — Set the maximum log size