Mail/Protocol/Smtp.php
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.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Mail
- Subpackage
- Protocol
- Version
- $Id$
\Zend_Mail_Protocol_Smtp
Package: Zend_Mail\Protocol















Smtp implementation of Zend_Mail_Protocol_Abstract
Minimum implementation according to RFC2821: EHLO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT
- Parent(s)
- \Zend_Mail_Protocol_Abstract
- Children
- \Zend_Mail_Protocol_Smtp_Auth_Crammd5
- \Zend_Mail_Protocol_Smtp_Auth_Plain
- \Zend_Mail_Protocol_Smtp_Auth_Login
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

\unknown_type $_auth = falseIndicates an smtp AUTH has been issued and authenticated
Default value
falseDetails- Type
- \unknown_type

\unknown_type $_data = nullIndicates that DATA has been issued and sent
Default value
nullDetails- Type
- \unknown_type

\unknown_type $_helo = falseIndicates the HELO command has been issues
Default value
falseDetails- Type
- \unknown_type

\unknown_type $_mail = falseIndicates a MAIL command has been issued
Default value
falseDetails- Type
- \unknown_type

\unknown_type $_rcpt = falseIndicates one or more RCTP commands have been issued
Default value
falseDetails- Type
- \unknown_type

boolean $_sess = falseIndicates an smtp session has been started by the HELO command
Default value
falseDetails- Type
- boolean
Methods

__construct(string $host = '127.0.0.1', integer $port = null, array $config = array()) : voidConstructor.
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $host | string | |
| $port | integer | |
| $config | array |
| Exception | Description |
|---|---|
| \Zend_Mail_Protocol_Exception |

_ehlo(string $host) : voidSend EHLO or HELO depending on capabilities of smtp host
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $host | string | The client hostname or IP address (default: 127.0.0.1) |
| Exception | Description |
|---|---|
| \Zend_Mail_Protocol_Exception |

auth() : voidDefault authentication method
This default method is implemented by AUTH adapters to properly authenticate to a remote host.
Throws| Exception | Description |
|---|---|
| \Zend_Mail_Protocol_Exception |

connect() : booleanConnect to the server with the parameters given in the constructor.
Returns
| Type | Description |
|---|---|
| boolean |

data(string $data) : voidIssues DATA command
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $data | string |
| Exception | Description |
|---|---|
| \Zend_Mail_Protocol_Exception |

helo(string $host = '127.0.0.1') : voidInitiate HELO/EHLO sequence and set flag to indicate valid smtp session
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $host | string | The client hostname or IP address (default: 127.0.0.1) |
| Exception | Description |
|---|---|
| \Zend_Mail_Protocol_Exception |

mail(string $from) : voidIssues MAIL command
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $from | string | Sender mailbox |
| Exception | Description |
|---|---|
| \Zend_Mail_Protocol_Exception |

noop() : voidIssues the NOOP command and validates answer
Not used by Zend_Mail, could be used to keep a connection alive or check if it is still open.

rcpt(string $to) : voidIssues RCPT command
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $to | string | Receiver(s) mailbox |
| Exception | Description |
|---|---|
| \Zend_Mail_Protocol_Exception |

rset() : voidIssues the RSET command and validates answer
Can be used to restore a clean smtp communication state when a transaction has been cancelled or commencing a new transaction.