Performs PLAIN authentication

Minimum implementation according to RFC2821: EHLO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT

category Zend
package Zend_Mail
subpackage Protocol
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Mail_Protocol_Smtp

 Methods

Constructor.

__construct(string $host = '127.0.0.1', integer $port = null, array $config = null) : void
inherited_from \Zend_Mail_Protocol_Smtp::__construct()

Parameters

$host

string

(Default: 127.0.0.1)

$port

integer

(Default: null)

$config

array

Auth-specific parameters

Constructor.

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

Parameters

$host

string

OPTIONAL Hostname of remote connection (default: 127.0.0.1)

$port

integer

OPTIONAL Port number (default: null)

Exceptions

\Zend_Mail_Protocol_Exception

Class destructor to cleanup open resources

__destruct() : void
Inherited

Perform PLAIN authentication with supplied credentials

auth() : void

This default method is implemented by AUTH adapters to properly authenticate to a remote host.

inherited_from \Zend_Mail_Protocol_Smtp::auth()

Default authentication method

auth() : void
Inherited

This default method is implemented by AUTH adapters to properly authenticate to a remote host.

Exceptions

\Zend_Mail_Protocol_Exception

Create a connection to the remote host

connect() 
Inherited

Concrete adapters for this class will implement their own unique connect scripts, using the _connect() method to create the socket resource.

Issues DATA command

data(string $data) : void
Inherited

Parameters

$data

string

Exceptions

\Zend_Mail_Protocol_Exception

Closes connection

disconnect() : void
Inherited

Retrieve the transaction log

getLog() : string
Inherited

Returns

string

Get the maximum log size

getMaximumLog() : integer
Inherited

Returns

integerthe maximum log size

Retrieve the last client request

getRequest() : string
Inherited

Returns

string

Retrieve the last server response

getResponse() : array
Inherited

Returns

array

Initiate HELO/EHLO sequence and set flag to indicate valid smtp session

helo(string $host = '127.0.0.1') : void
Inherited

Parameters

$host

string

The client hostname or IP address (default: 127.0.0.1)

Exceptions

\Zend_Mail_Protocol_Exception

Issues MAIL command

mail(string $from) : void
Inherited

Parameters

$from

string

Sender mailbox

Exceptions

\Zend_Mail_Protocol_Exception

Issues the NOOP command and validates answer

noop() : void
Inherited

Not used by Zend_Mail, could be used to keep a connection alive or check if it is still open.

Issues the QUIT command and clears the current session

quit() : void
Inherited

Issues RCPT command

rcpt(string $to) : void
Inherited

Parameters

$to

string

Receiver(s) mailbox

Exceptions

\Zend_Mail_Protocol_Exception

Reset the transaction log

resetLog() : void
Inherited

Issues the RSET command and validates answer

rset() : void
Inherited

Can be used to restore a clean smtp communication state when a transaction has been cancelled or commencing a new transaction.

Set the maximum log size

setMaximumLog(integer $maximumLog) : void
Inherited

Parameters

$maximumLog

integer

Maximum log size

Issues the VRFY command and validates answer

vrfy(string $user) : void
Inherited

Not used by Zend_Mail.

Parameters

$user

string

User Name or eMail to verify

Add the transaction log

_addLog($value) : void
Inherited

Parameters

$value

Connect to the server using the supplied transport and target

_connect(string $remote) : boolean
Inherited

An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'

Parameters

$remote

string

Remote

Exceptions

\Zend_Mail_Protocol_Exception

Returns

boolean

Disconnect from remote host and free resource

_disconnect() : void
Inherited

Send EHLO or HELO depending on capabilities of smtp host

_ehlo(string $host) : void
Inherited

Parameters

$host

string

The client hostname or IP address (default: 127.0.0.1)

Exceptions

\Zend_Mail_Protocol_Exception

Parse server response for successful codes

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

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

$code

stringarray

One or more codes that indicate a successful response

$timeout

Exceptions

\Zend_Mail_Protocol_Exception

Returns

stringLast line of response string

Get a line from the stream.

_receive($timeout = null) : string
Inherited
var

Per-request timeout value if applicable

Parameters

$timeout

Exceptions

\Zend_Mail_Protocol_Exception

Returns

string

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

_send(string $request) : integer | boolean
Inherited

Parameters

$request

string

Exceptions

\Zend_Mail_Protocol_Exception

Returns

integerbooleanNumber of bytes written to remote host

Set stream timeout

_setStreamTimeout(integer $timeout) : boolean
Inherited

Parameters

$timeout

integer

Returns

boolean

Start mail session

_startSession() : void
Inherited

Stop mail session

_stopSession() : void
Inherited

 Properties

 

Indicates an smtp AUTH has been issued and authenticated

$_auth : \unknown_type

Default

false
 

Indicates that DATA has been issued and sent

$_data : \unknown_type

Default

null
 

Indicates the HELO command has been issues

$_helo : \unknown_type

Default

false
 

Hostname or IP address of remote server

$_host : string

Default

 

Indicates a MAIL command has been issued

$_mail : \unknown_type

Default

false
 

Maximum of the transaction log

$_maximumLog : integer

Default

64
 

PLAIN password

$_password : string

Default

 

Port number of connection

$_port : integer

Default

 

Indicates one or more RCTP commands have been issued

$_rcpt : \unknown_type

Default

false
 

Last request sent to server

$_request : string

Default

 

Array of server responses to last request

$_response : array

Default

 

Indicates that a session is requested to be secure

$_secure : string

Default

 

Indicates an smtp session has been started by the HELO command

$_sess : boolean

Default

false
 

Socket connection resource

$_socket : resource

Default

 

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

$_template : resource

Default

'%d%s'
deprecated Since 1.10.3
 

The transport method for the socket

$_transport : string

Default

'tcp'
 

PLAIN username

$_username : string

Default

 

Instance of Zend_Validate to check hostnames

$_validHost : \Zend_Validate

Default

 

Log of mail requests and server responses for a session

$_log : array

Default

array()

 Constants

 

Mail default EOL string

EOL = "\r\n" 
 

Default timeout in seconds for initiating session

TIMEOUT_CONNECTION = 30