get_current_webmail_account($user); //$pop3 = new POP3($current["pop"], $current["username"], $current["pass"]); //$pop3->Open(); $pop3->connect($current["pop"]); $pop3->login($current["username"], $current["pass"]); $full = $pop3->getMsg($_REQUEST["msgid"]); $smarty->assign('msgid', $_REQUEST["msgid"]); $pop3->disconnect(); $params = array( 'input' => $full, 'crlf' => "\r\n", 'include_bodies' => TRUE, 'decode_headers' => TRUE, 'decode_bodies' => TRUE ); $output = Mail_mimeDecode::decode($params); $part = $output->parts[$_REQUEST["getpart"]]; $type = $part->headers["content-type"]; $content = $part->body; $names = split(';', $part->headers["content-disposition"]); $names = split('=', $names[1]); $file = $names[1]; header ("Content-type: $type"); //header( "Content-Disposition: attachment; filename=$file" ); header ("Content-Disposition: inline; filename=$file"); echo "$content"; ?>