Class Smtp

Summary

Fully Qualified Name: Zend\Mail\Protocol\Smtp
Extends: AbstractProtocol

Description

SMTP implementation of Zend\Mail\Protocol\AbstractProtocol

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

Methods

Name Description Defined By
__construct() Constructor. Smtp
__destruct() Class destructor to cleanup open resources AbstractProtocol
auth() Default authentication method Smtp
connect() Connect to the server with the parameters given in the constructor. Smtp
data() Issues DATA command Smtp
disconnect() Closes connection Smtp
getLog() Retrieve the transaction log AbstractProtocol
getMaximumLog() Get the maximum log size AbstractProtocol
getRequest() Retrieve the last client request AbstractProtocol
getResponse() Retrieve the last server response AbstractProtocol
hasSession() Returns the perceived session status Smtp
helo() Initiate HELO/EHLO sequence and set flag to indicate valid smtp session Smtp
mail() Issues MAIL command Smtp
noop() Issues the NOOP command end validates answer Smtp
quit() Issues the QUIT command and clears the current session Smtp
rcpt() Issues RCPT command Smtp
resetLog() Reset the transaction log AbstractProtocol
rset() Issues the RSET command end validates answer Smtp
setMaximumLog() Set the maximum log size AbstractProtocol
setUseCompleteQuit() Set whether or not send QUIT command Smtp
useCompleteQuit() Whether or not send QUIT command Smtp
vrfy() Issues the VRFY command end validates answer Smtp

Method Details

__construct()

Constructor.

The first argument may be an array of all options. If so, it must include the 'host' and 'port' keys in order to ensure that all required values are present.

Parameter Name Type Description
$host string|array
$port null|int
$config null|array

Returns:

__destruct()

Class destructor to cleanup open resources

Returns:

auth()

Default authentication method

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

Returns:

connect()

Connect to the server with the parameters given in the constructor.

Returns: bool

data()

Issues DATA command

Parameter Name Type Description
$data string

Returns:

disconnect()

Closes connection

Returns:

getLog()

Retrieve the transaction log

Returns: string

getMaximumLog()

Get the maximum log size

Returns: int the maximum log size

getRequest()

Retrieve the last client request

Returns: string

getResponse()

Retrieve the last server response

Returns: array

hasSession()

Returns the perceived session status

Returns: bool

helo()

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

Parameter Name Type Description
$host string The

Returns:

mail()

Issues MAIL command

Parameter Name Type Description
$from string Sender

Returns:

noop()

Issues the NOOP command end validates answer

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

Returns:

quit()

Issues the QUIT command and clears the current session

Returns:

rcpt()

Issues RCPT command

Parameter Name Type Description
$to string Receiver(s)

Returns:

resetLog()

Reset the transaction log

Returns:

rset()

Issues the RSET command end validates answer

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

Returns:

setMaximumLog()

Set the maximum log size

Parameter Name Type Description
$maximumLog int Maximum

Returns:

setUseCompleteQuit()

Set whether or not send QUIT command

Parameter Name Type Description
$useCompleteQuit bool use

Returns: bool

useCompleteQuit()

Whether or not send QUIT command

Returns: bool

vrfy()

Issues the VRFY command end validates answer

Not used by Zend\Mail.

Parameter Name Type Description
$user string User

Returns:

Top