1484. Class

1484.1. Zend\Mail\Protocol\Smtp

SMTP implementation of ZendMailProtocolAbstractProtocol

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

1484.1.1. Methods

1484.1.1.1. __construct

__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.

Parameters:
  • string|array
  • null|integer
  • null|array
Throws ExceptionInvalidArgumentException:
 

1484.1.1.2. connect

connect()

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

Return type:bool

1484.1.1.3. helo

helo()

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

Parameters:string – The client hostname or IP address (default: 127.0.0.1)
Throws ExceptionRuntimeException:
 

1484.1.1.4. hasSession

hasSession()

Returns the perceived session status

Return type:boolean

1484.1.1.5. _ehlo

_ehlo()

Send EHLO or HELO depending on capabilities of smtp host

Parameters:string – The client hostname or IP address (default: 127.0.0.1)
Throws Exception|ExceptionExceptionInterface:
 

1484.1.1.6. mail

mail()

Issues MAIL command

Parameters:string – Sender mailbox
Throws ExceptionRuntimeException:
 

1484.1.1.7. rcpt

rcpt()

Issues RCPT command

Parameters:string – Receiver(s) mailbox
Throws ExceptionRuntimeException:
 

1484.1.1.8. data

data()

Issues DATA command

Parameters:string
Throws ExceptionRuntimeException:
 

1484.1.1.9. rset

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.

1484.1.1.10. noop

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.

1484.1.1.11. vrfy

vrfy()

Issues the VRFY command end validates answer

Not used by Zend_Mail.

Parameters:string – User Name or eMail to verify

1484.1.1.12. quit

quit()

Issues the QUIT command and clears the current session

1484.1.1.13. auth

auth()

Default authentication method

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

1484.1.1.14. disconnect

disconnect()

Closes connection

1484.1.1.15. _startSession

_startSession()

Start mail session

1484.1.1.16. _stopSession

_stopSession()

Stop mail session