original_string: protected function _smtpSend($data, $checkCode = '250')
      {
          $this->_lastResponse = [];
  
          if ($data !== null) {
              $this->_socket->write($data . "\r\n");
          }
  
          $timeout = $this->_config['timeout'];
  
          while ($checkCode !== false) {
              $response = '';
              $startTime = time();
              while (substr($response, -2) !== "\r\n" && ((time() - $startTime) < $timeout)) {
                  $bytes = $this->_socket->read();
                  if ($bytes === false || $bytes === null) {
                      break;
                  }
                  $response .= $bytes;
              }
              if (substr($response, -2) !== "\r\n") {
                  throw new SocketException('SMTP timeout.');
              }
              $responseLines = explode("\r\n", rtrim($response, "\r\n"));
              $response = end($responseLines);
  
              $this->_bufferResponseLines($responseLines);
  
              if (preg_match('/^(' . $checkCode . ')(.)/', $response, $code)) {
                  if ($code[2] === '-') {
                      continue;
                  }
  
                  return $code[1];
              }
              throw new SocketException(sprintf('SMTP Error: %s', $response));
          }
      }
code: protected function _smtpSend($data, $checkCode = '250')
      {
          $this->_lastResponse = [];
  
          if ($data !== null) {
              $this->_socket->write($data . "\r\n");
          }
  
          $timeout = $this->_config['timeout'];
  
          while ($checkCode !== false) {
              $response = '';
              $startTime = time();
              while (substr($response, -2) !== "\r\n" && ((time() - $startTime) < $timeout)) {
                  $bytes = $this->_socket->read();
                  if ($bytes === false || $bytes === null) {
                      break;
                  }
                  $response .= $bytes;
              }
              if (substr($response, -2) !== "\r\n") {
                  throw new SocketException('SMTP timeout.');
              }
              $responseLines = explode("\r\n", rtrim($response, "\r\n"));
              $response = end($responseLines);
  
              $this->_bufferResponseLines($responseLines);
  
              if (preg_match('/^(' . $checkCode . ')(.)/', $response, $code)) {
                  if ($code[2] === '-') {
                      continue;
                  }
  
                  return $code[1];
              }
              throw new SocketException(sprintf('SMTP Error: %s', $response));
          }
      }
code_tokens: protected function _smtpSend ( $ data , $ checkCode = '250' ) { $ this -> _lastResponse = [ ] ; if ( $ data !== null ) { $ this -> _socket -> write ( $ data . "\r\n" ) ; } $ timeout = $ this -> _config [ 'timeout' ] ; while ( $ checkCode !== false ) { $ response = '' ; $ startTime = time ( ) ; while ( substr ( $ response , - 2 ) !== "\r\n" && ( ( time ( ) - $ startTime ) < $ timeout ) ) { $ bytes = $ this -> _socket -> read ( ) ; if ( $ bytes === false || $ bytes === null ) { break ; } $ response .= $ bytes ; } if ( substr ( $ response , - 2 ) !== "\r\n" ) { throw new SocketException ( 'SMTP timeout.' ) ; } $ responseLines = explode ( "\r\n" , rtrim ( $ response , "\r\n" ) ) ; $ response = end ( $ responseLines ) ; $ this -> _bufferResponseLines ( $ responseLines ) ; if ( preg_match ( '/^(' . $ checkCode . ')(.)/' , $ response , $ code ) ) { if ( $ code [ 2 ] === '-' ) { continue ; } return $ code [ 1 ] ; } throw new SocketException ( sprintf ( 'SMTP Error: %s' , $ response ) ) ; } }
docstring: Protected method for sending data to SMTP connection
  
  @param string|null $data Data to be sent to SMTP server
  @param string|bool $checkCode Code to check for in server response, false to skip
  @return string|null The matched code, or null if nothing matched
  @throws \Cake\Network\Exception\SocketException
docstring_tokens: Protected method for sending data to SMTP connection