Definition at line 51 of file Smtp.php.
◆ __construct()
__construct |
( |
|
$host = '127.0.0.1' , |
|
|
Array |
$config = array() |
|
) |
| |
Constructor.
- Parameters
-
string | $host | OPTIONAL (Default: 127.0.0.1) |
array | null | $config | OPTIONAL (Default: null) |
- Returns
- void
- Todo:
- Someone please make this compatible with the SendMail transport class.
Definition at line 118 of file Smtp.php.
121 $this->_name =
$config[
'name'];
124 $this->_port =
$config[
'port'];
127 $this->_auth =
$config[
'auth'];
130 $this->_host = $host;
◆ __destruct()
Class destructor to ensure all open connections are closed
- Returns
- void
Definition at line 140 of file Smtp.php.
144 $this->_connection->quit();
148 $this->_connection->disconnect();
◆ _prepareHeaders()
_prepareHeaders |
( |
|
$headers | ) |
|
|
protected |
Format and fix headers
Some SMTP servers do not strip BCC headers. Most clients do it themselves as do we.
@access protected
- Parameters
-
- Returns
- void
- Exceptions
-
- See also
- Zend_Mail_Transport_Exception
Definition at line 228 of file Smtp.php.
234 #require_once 'Zend/Mail/Transport/Exception.php'; 238 unset($headers[
'Bcc']);
241 parent::_prepareHeaders($headers);
◆ _sendMail()
Send an email via the SMTP connection protocol
The connection via the protocol adapter is made just-in-time to allow a developer to add a custom adapter if required before mail is sent.
- Returns
- void
- Todo:
- Rename this to sendMail, it's a public method...
Definition at line 185 of file Smtp.php.
190 $connectionClass =
'Zend_Mail_Protocol_Smtp';
192 $connectionClass .=
'_Auth_' . ucwords($this->_auth);
195 #require_once 'Zend/Loader.php'; 198 $this->
setConnection(
new $connectionClass($this->_host, $this->_port, $this->_config));
199 $this->_connection->connect();
200 $this->_connection->helo($this->_name);
203 $this->_connection->rset();
207 $this->_connection->mail($this->_mail->getReturnPath());
210 foreach ($this->_mail->getRecipients() as $recipient) {
211 $this->_connection->rcpt($recipient);
static loadClass($class, $dirs=null)
setConnection(Zend_Mail_Protocol_Abstract $connection)
◆ getConnection()
Gets the connection protocol instance
- Returns
- Zend_Mail_Protocol|null
Definition at line 171 of file Smtp.php.
◆ setConnection()
Sets the connection protocol instance
- Parameters
-
- Returns
- void
Definition at line 160 of file Smtp.php.
◆ $_auth
◆ $_config
◆ $_connection
◆ $_host
◆ $_name
◆ $_port
◆ $EOL
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Mail/Transport/Smtp.php