API Documentation

Mail/Protocol/Abstract.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Mail
subpackage
Protocol
version
$Id: Abstract.php 21635 2010-03-24 15:25:13Z yoshida@zend.co.jp $
Classes
Zend_Mail_Protocol_Abstract

Description

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

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Mail
subpackage
Protocol
todo
Implement proxy settings
version
$Id: Abstract.php 21635 2010-03-24 15:25:13Z yoshida@zend.co.jp $
Constants
EOL
TIMEOUT_CONNECTION
MAXIMUM_LOG
Properties
$_host
$_port
$_validHost
$_socket
$_request
$_response
$_template
$_log
Methods
__construct
__destruct
connect
getRequest
getResponse
getLog
resetLog
_addLog
_connect
_disconnect
_send
_receive
_expect

Description

Zend_Mail_Protocol_Abstract

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

Constants

EOL

 EOL = '\r\n'

Mail default EOL string

Details

value
\r\n

TIMEOUT_CONNECTION

 TIMEOUT_CONNECTION = '30'

Default timeout in seconds for initiating session

Details

value
30

MAXIMUM_LOG

 MAXIMUM_LOG = '64'

Maximum of the transaction log

Details

value
64

Properties

$_host

string $_host = ''

Hostname or IP address of remote server

Details

$_host
string
visibility
protected
default
final
false
static
false

$_log

array $_log = 'array'

Log of mail requests and server responses for a session

Details

$_log
array
visibility
private
default
array
final
false
static
false

$_port

integer $_port = ''

Port number of connection

Details

$_port
integer
visibility
protected
default
final
false
static
false

$_request

string $_request = ''

Last request sent to server

Details

$_request
string
visibility
protected
default
final
false
static
false

$_response

array $_response = ''

Array of server responses to last request

Details

$_response
array
visibility
protected
default
final
false
static
false

$_socket

resource $_socket = ''

Socket connection resource

Details

$_socket
resource
visibility
protected
default
final
false
static
false

$_template

resource $_template = '%d%s'

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

Details

$_template
resource
visibility
protected
default
%d%s
final
false
static
false
deprecated
Since 1.10.3

$_validHost

Zend_Validate $_validHost = ''

Instance of Zend_Validate to check hostnames

Details

$_validHost
Zend_Validate
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( string $host = 127.0.0.1, integer $port = null ) : void

Constructor.

Arguments
$host
string
OPTIONAL Hostname of remote connection (default: 127.0.0.1)
$port
integer
OPTIONAL Port number (default: null)
Details
visibility
public
final
false
static
false
throws

__destruct

__destruct( ) : void

Class destructor to cleanup open resources

Details
visibility
public
final
false
static
false

_addLog

_addLog( string $value ) : void

Add the transaction log

Arguments
$value
string
new transaction
Details
visibility
protected
final
false
static
false

_connect

_connect( string $remote ) : boolean

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'

Arguments
$remote
string
Remote
Output
boolean
Details
visibility
protected
final
false
static
false
throws

_disconnect

_disconnect( ) : void

Disconnect from remote host and free resource

Details
visibility
protected
final
false
static
false

_expect

_expect( string|array $code,  $timeout = null ) : string

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.

Arguments
$code
stringarray
One or more codes that indicate a successful response
$timeout
Output
string
Last line of response string
Details
visibility
protected
final
false
static
false
throws

_receive

_receive(  $timeout = null ) : string

Get a line from the stream.

Arguments
$timeout
Output
string
Details
visibility
protected
final
false
static
false
throws
$timeout
integer
Per-request timeout value if applicable

_send

_send( string $request ) : integer|boolean

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

Arguments
$request
string
Output
integer|boolean
Number of bytes written to remote host
Details
visibility
protected
final
false
static
false
throws

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.

Details
visibility
public
final
false
static
false

getLog

getLog( ) : string

Retrieve the transaction log

Output
string
Details
visibility
public
final
false
static
false

getRequest

getRequest( ) : string

Retrieve the last client request

Output
string
Details
visibility
public
final
false
static
false

getResponse

getResponse( ) : array

Retrieve the last server response

Output
array
Details
visibility
public
final
false
static
false

resetLog

resetLog( ) : void

Reset the transaction log

Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.