__construct()
__destruct()
connect()
getLog()
getMaximumLog()
getRequest()
getResponse()
resetLog()
setMaximumLog()
_addLog()
_connect()
_disconnect()
_expect()
_receive()
_send()
$host
$maximumLog
$port
$request
$response
$socket
$validHost
$log
EOL
TIMEOUT_CONNECTION
Provides low-level methods for concrete adapters to communicate with a remote mail server and track requests and responses.
| todo | Implement proxy settings |
|---|
__construct(string $host, int $port)
stringOPTIONAL Hostname of remote connection (default: 127.0.0.1)
intOPTIONAL Port number (default: null)
\Zend\Mail\Protocol\Exception\RuntimeException |
|---|
__destruct()
connect()
Concrete adapters for this class will implement their own unique connect scripts, using the _connect() method to create the socket resource.
getLog() : string
stringgetMaximumLog() : int
intthe maximum log sizegetRequest() : string
stringgetResponse() : array
arrayresetLog()
setMaximumLog(int $maximumLog)
intMaximum log size
_addLog(string $value)
stringnew transaction
_connect(string $remote) : bool
An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'
stringRemote
\Zend\Mail\Protocol\Exception\RuntimeException |
|---|
bool_disconnect()
_expect(string | array $code, int $timeout) : string
Read the response from the stream and check for expected return code. Throws a Zend\Mail\Protocol\Exception\ExceptionInterface if an unexpected code is returned.
stringarrayOne or more codes that indicate a successful response
intPer-request timeout value if applicable
\Zend\Mail\Protocol\Exception\RuntimeException |
|---|
stringLast line of response string_receive(int $timeout) : string
intPer-request timeout value if applicable
\Zend\Mail\Protocol\Exception\RuntimeException |
|---|
string_send(string $request) : int | bool
string
\Zend\Mail\Protocol\Exception\RuntimeException |
|---|
intboolNumber of bytes written to remote host$host : string
$maximumLog : int
$port : int
$request : string
$response : array
$socket : resource
$validHost : \Zend\Validator\ValidatorChain
$log : array
EOL
TIMEOUT_CONNECTION