Пример #1
0
 }
 if ($_REQUEST["msgid"] > 1) {
     $smarty->assign('prev', $_REQUEST["msgid"] - 1);
 } else {
     $smarty->assign('prev', '');
 }
 $full = $pop3->getMsg($_REQUEST["msgid"]);
 $pop3->disconnect();
 $output = mime::decode($full);
 //echo "<pre>OUTPUT:";print_r($output); echo"</pre>";
 $bodies = mime::get_bodies($output);
 $temp_max = count($bodies);
 for ($i = 0; $i < $temp_max; $i++) {
     $bodies[$i] = strip_tags($bodies[$i], "<a><b><i><table><tr><td><th><ul><li><img><hr><ol><br /><h1><h2><h3><h4><h5><h6><div><span><font><form><input><textarea><checkbox><select>");
 }
 $attachments = mime::get_attachments($output);
 $smarty->assign('attachs', $attachments);
 $smarty->assign('bodies', $bodies);
 $allbodies = join("\n", $bodies);
 $allbodies = "\n\n------------------------------------------\n" . $allbodies;
 $smarty->assign('allbodies', htmlspecialchars($allbodies));
 $to_addresses = $output['header']["from"];
 // Get email addresses from the "from" portion
 $to_addresses = split(',', $to_addresses);
 $temp_max = count($to_addresses);
 for ($i = 0; $i < $temp_max; $i++) {
     preg_match("/<([^>]+)>/", $to_addresses[$i], $add);
     if (isset($add[1])) {
         $to_addresses[$i] = $add[1];
     }
 }