_username = $config['username']; } if (isset($config['password'])) { $this->_password = $config['password']; } } parent::__construct($host, $port, $config); } /** * Perform PLAIN authentication with supplied credentials * * @return void */ public function auth() { // Ensure AUTH has not already been initiated. parent::auth(); $this->_send('AUTH PLAIN'); $this->_expect(334); $this->_send(base64_encode(chr(0) . $this->_username . chr(0) . $this->_password)); $this->_expect(235); $this->_auth = true; } }