Section ".$_GET['p']; print ""; ob_start(); /* extract the part from the message file and dump it to * the output buffer */ mailparse_msg_extract_part_file($sec, $file); $contents = ob_get_contents(); ob_end_clean(); /* quote the message for safe display in a browser */ print nl2br(htmlentities($contents)) ; print ""; break; default: $hstr = "Content-Type: ".$info['content-type']; if ( isset($info['charset']) ) $hstr .= "; charset=".$info['charset']; header($hstr); ob_start(); mailparse_msg_extract_part_file($sec, $file); ob_end_flush(); }; } else { header("Content-Type: text/plain"); $res = fopen( $file, "r"); while (!feof($res)) { $buffer = fgets($res, 4096); print $buffer; }; fclose($res); }; } else { print "\n\n"; foreach($struct as $st) { print "\n"; print "\n"; /* get a handle on the message resource for a subsection */ $section = mailparse_msg_get_part($mime, $st); /* get content-type, encoding and header information for that section */ $info = mailparse_msg_get_part_data($section); print "\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "
"; print "Raw source\n"; print "
"; print $st."".$info['content-type']."".(isset($info['content-disposition']) ? $info['content-disposition'] : " ")."".(isset($info['disposition-filename']) ? $info['disposition-filename'] : " ")."".(isset($info['charset']) ? $info['charset'] : " ")."
"; }; ?>