src/Imap.php
protected function send($command, $parameters = array())
    {
        $this->tag ++;

        $line = 'TAG' . $this->tag . ' ' . $command;

        if (!is_array($parameters)) {
            $parameters = array($parameters);
        }

        foreach ($parameters as $parameter) {
            if (is_array($parameter)) {
                if (fputs($this->socket, $line . ' ' . $parameter[0] . "\r\n") === false) {
                    return false;
                }

                if (strpos($this->getLine(), '+ ') === false) {
                    return false;
                }

                $line = $parameter[1];
            } else {
                $line .= ' ' . $parameter;
            }
        }

        $this->debug('Sending: '.$line);

        return fputs($this->socket, $line . "\r\n");
    }
protected function send($command, $parameters = array())
    {
        $this->tag ++;

        $line = 'TAG' . $this->tag . ' ' . $command;

        if (!is_array($parameters)) {
            $parameters = array($parameters);
        }

        foreach ($parameters as $parameter) {
            if (is_array($parameter)) {
                if (fputs($this->socket, $line . ' ' . $parameter[0] . "\r\n") === false) {
                    return false;
                }

                if (strpos($this->getLine(), '+ ') === false) {
                    return false;
                }

                $line = $parameter[1];
            } else {
                $line .= ' ' . $parameter;
            }
        }

        $this->debug('Sending: '.$line);

        return fputs($this->socket, $line . "\r\n");
    }
protected function send ( $ command , $ parameters = array ( ) ) { $ this -> tag ++ ; $ line = 'TAG' . $ this -> tag . ' ' . $ command ; if ( ! is_array ( $ parameters ) ) { $ parameters = array ( $ parameters ) ; } foreach ( $ parameters as $ parameter ) { if ( is_array ( $ parameter ) ) { if ( fputs ( $ this -> socket , $ line . ' ' . $ parameter [ 0 ] . "\r\n" ) === false ) { return false ; } if ( strpos ( $ this -> getLine ( ) , '+ ' ) === false ) { return false ; } $ line = $ parameter [ 1 ] ; } else { $ line .= ' ' . $ parameter ; } } $ this -> debug ( 'Sending: ' . $ line ) ; return fputs ( $ this -> socket , $ line . "\r\n" ) ; }
Sends out the command

@param *string $command   The raw IMAP command
@param array   $parameter Parameters to include

@return bool
Sends out the command