28 #require_once 'Zend/Mime.php'; 34 #require_once 'Zend/Mail/Protocol/Abstract.php'; 126 switch (strtolower(
$config[
'ssl'])) {
128 $this->_secure =
'tls';
132 $this->_transport =
'ssl';
133 $this->_secure =
'ssl';
143 #require_once 'Zend/Mail/Protocol/Exception.php'; 151 if (($port =
ini_get(
'smtp_port')) ==
'') {
156 parent::__construct($host, $port);
167 return $this->
_connect($this->_transport .
'://' . $this->_host .
':'. $this->_port);
178 public function helo($host =
'127.0.0.1')
181 if ($this->_sess ===
true) {
185 #require_once 'Zend/Mail/Protocol/Exception.php'; 190 if (!$this->_validHost->isValid($host)) {
194 #require_once 'Zend/Mail/Protocol/Exception.php'; 203 if ($this->_secure ==
'tls') {
204 $this->
_send(
'STARTTLS');
207 if (!stream_socket_enable_crypto($this->_socket,
true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT)) {
211 #require_once 'Zend/Mail/Protocol/Exception.php'; 233 $this->
_send(
'EHLO ' . $host);
236 $this->
_send(
'HELO ' . $host);
253 if ($this->_sess !==
true) {
257 #require_once 'Zend/Mail/Protocol/Exception.php'; 261 $this->
_send(
'MAIL FROM:<' . $from .
'>');
266 $this->_rcpt =
false;
267 $this->_data =
false;
280 if ($this->_mail !==
true) {
284 #require_once 'Zend/Mail/Protocol/Exception.php'; 289 $this->
_send(
'RCPT TO:<' . $to .
'>');
290 $this->
_expect(array(250, 251), 300);
305 if ($this->_rcpt !==
true) {
309 #require_once 'Zend/Mail/Protocol/Exception.php'; 313 $this->
_send(
'DATA');
317 if (strpos($line,
'.') === 0) {
339 $this->
_send(
'RSET');
341 $this->
_expect(array(250, 220));
343 $this->_mail =
false;
344 $this->_rcpt =
false;
345 $this->_data =
false;
358 $this->
_send(
'NOOP');
374 $this->
_expect(array(250, 251, 252), 300);
386 $this->
_send(
'QUIT');
403 if ($this->_auth ===
true) {
407 #require_once 'Zend/Mail/Protocol/Exception.php'; 442 $this->_sess =
false;
_expect($code, $timeout=null)
__construct($host='127.0.0.1', $port=null, array $config=array())