1481. Class

1481.1. Zend\Mail\Protocol\AbstractProtocol

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

1481.1.1. Methods

1481.1.1.1. __construct

__construct()

Constructor.

Parameters:
  • string – OPTIONAL Hostname of remote connection (default: 127.0.0.1)
  • integer – OPTIONAL Port number (default: null)
Throws ExceptionRuntimeException:
 

1481.1.1.2. __destruct

__destruct()

Class destructor to cleanup open resources

1481.1.1.3. setMaximumLog

setMaximumLog()

Set the maximum log size

Parameters:integer – Maximum log size

1481.1.1.4. getMaximumLog

getMaximumLog()

Get the maximum log size

Return type:int the maximum log size

1481.1.1.5. connect

connect()

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.

1481.1.1.6. getRequest

getRequest()

Retrieve the last client request

Return type:string

1481.1.1.7. getResponse

getResponse()

Retrieve the last server response

Return type:array

1481.1.1.8. getLog

getLog()

Retrieve the transaction log

Return type:string

1481.1.1.9. resetLog

resetLog()

Reset the transaction log

1481.1.1.10. _addLog

_addLog()

Add the transaction log

Parameters:string – new transaction

1481.1.1.11. _connect

_connect()

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

Parameters:string – Remote
Throws ExceptionRuntimeException:
 
Return type:bool

1481.1.1.12. _disconnect

_disconnect()

Disconnect from remote host and free resource

1481.1.1.13. _send

_send()

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

Parameters:string
Throws ExceptionRuntimeException:
 
Return type:integer|bool Number of bytes written to remote host

1481.1.1.14. _receive

_receive()

Get a line from the stream.

Parameters:integer – Per-request timeout value if applicable
Throws ExceptionRuntimeException:
 
Return type:string

1481.1.1.15. _expect

_expect()

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.

Parameters:
  • string|array – One or more codes that indicate a successful response
  • integer – Per-request timeout value if applicable
Throws ExceptionRuntimeException:
 
Return type:

string Last line of response string

1481.1.2. Constants

1481.1.2.1. EOL

Mail default EOL string

1481.1.2.2. TIMEOUT_CONNECTION

Default timeout in seconds for initiating session