Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Plain.php
Go to the documentation of this file.
1 <?php
27 #require_once 'Zend/Mail/Protocol/Smtp.php';
28 
29 
40 {
46  protected $_username;
47 
48 
54  protected $_password;
55 
56 
65  public function __construct($host = '127.0.0.1', $port = null, $config = null)
66  {
67  if (is_array($config)) {
68  if (isset($config['username'])) {
69  $this->_username = $config['username'];
70  }
71  if (isset($config['password'])) {
72  $this->_password = $config['password'];
73  }
74  }
75 
76  parent::__construct($host, $port, $config);
77  }
78 
79 
85  public function auth()
86  {
87  // Ensure AUTH has not already been initiated.
88  parent::auth();
89 
90  $this->_send('AUTH PLAIN');
91  $this->_expect(334);
92  $this->_send(base64_encode("\0" . $this->_username . "\0" . $this->_password));
93  $this->_expect(235);
94  $this->_auth = true;
95  }
96 }
_expect($code, $timeout=null)
Definition: Abstract.php:402
$config
Definition: fraud_order.php:17
__construct($host='127.0.0.1', $port=null, $config=null)
Definition: Plain.php:65