private function header2String($header)
    {
        $str = '';
        if (is_array($header)) foreach ($header as $k=>$v) {
            if (is_numeric($k)) continue;
            $str .= $k . ': ' . $v . "\r\n";
        } else {
            $str = $header;
        }
        return $str;
    }