private function write($command, $code = null, $message = null)
    {
        if ($message == null) {
            $message = $command;
        }

        $command = $command . Message::END;

        fwrite($this->sock, $command, strlen($command));

        $response = null;


        if ($code !== null) {
            $response = $this->read();

            if (!in_array($response, (array) $code)) {
                $message = isset($message) ? $message : '';

                throw new SmtpException(
                    sprintf('SMTP server did not accept %s with code [%s]', $message, $response),
                    E_ERROR
                );
            }
        }

        return $response;
    }
private function write($command, $code = null, $message = null)
    {
        if ($message == null) {
            $message = $command;
        }

        $command = $command . Message::END;

        fwrite($this->sock, $command, strlen($command));

        $response = null;


        if ($code !== null) {
            $response = $this->read();

            if (!in_array($response, (array) $code)) {
                $message = isset($message) ? $message : '';

                throw new SmtpException(
                    sprintf('SMTP server did not accept %s with code [%s]', $message, $response),
                    E_ERROR
                );
            }
        }

        return $response;
    }
private function write ( $ command , $ code = null , $ message = null ) { if ( $ message == null ) { $ message = $ command ; } $ command = $ command . Message :: END ; fwrite ( $ this -> sock , $ command , strlen ( $ command ) ) ; $ response = null ; if ( $ code !== null ) { $ response = $ this -> read ( ) ; if ( ! in_array ( $ response , ( array ) $ code ) ) { $ message = isset ( $ message ) ? $ message : '' ; throw new SmtpException ( sprintf ( 'SMTP server did not accept %s with code [%s]' , $ message , $ response ) , E_ERROR ) ; } } return $ response ; }
Start an SMTP command

@param string $command
@param int    $code
@param null   $message

@throws SmtpException
@return string
Start an SMTP command