public function connectAndAuthenticate() {
		// 1. connect
		if (!$this->isConnected()) {
			$this->connect();
		}
		$this->hello();
		
		// 2. open tls connection if needed
		$securityMode = $this->config->getSecurityMode();
		if ($securityMode == SmtpConfig::SECURITY_MODE_TLS) {
			$this->startTls();
			$this->hello();
		}
		
		// 3. authenticat if needed
		if ($this->config->doAuthenticate()) {
			$this->authenticate();
		}
	}
public function connectAndAuthenticate() {
		// 1. connect
		if (!$this->isConnected()) {
			$this->connect();
		}
		$this->hello();
		
		// 2. open tls connection if needed
		$securityMode = $this->config->getSecurityMode();
		if ($securityMode == SmtpConfig::SECURITY_MODE_TLS) {
			$this->startTls();
			$this->hello();
		}
		
		// 3. authenticat if needed
		if ($this->config->doAuthenticate()) {
			$this->authenticate();
		}
	}
public function connectAndAuthenticate ( ) { // 1. connect
 if ( ! $ this -> isConnected ( ) ) { $ this -> connect ( ) ; } $ this -> hello ( ) ; // 2. open tls connection if needed
 $ securityMode = $ this -> config -> getSecurityMode ( ) ; if ( $ securityMode == SmtpConfig :: SECURITY_MODE_TLS ) { $ this -> startTls ( ) ; $ this -> hello ( ) ; } // 3. authenticat if needed
 if ( $ this -> config -> doAuthenticate ( ) ) { $ this -> authenticate ( ) ; } }
method to call connect, hello, tls, hello and authenticate if needed
method to call connect hello tls hello and authenticate if needed