【php开源代码栏目提醒】:网学会员--在 php开源代码编辑为广大网友搜集整理了:readmsg.php绩等信息,祝愿广大网友取得需要的信息,参考学习。
<?
//包含session_management.php文件
include("session_management.php");
echo($nocache);
if(!isset($ix) || !isset($pag)) die("<script language=\"javascript\">location = 'error.php?msg=".urlencode($error_other)."&sid=$sid&lid=$lid';</script>");
$md = new mime_decode();
//读取邮件信息
$tcontent = read_file($read_message_template);
if ($folder == "inbox" && !isset($search)) {
$mysess = $sess["headers"];
$mail_info = $sess["headers"][$ix];
$mnum = $mail_info["id"];
$mid = md5($mail_info["message-id"]);
$msize = $mail_info["size"];
$localname = $mail_info["localname"];
if(!file_exists($localname)) {
//如果连接服务器失败,则提示错误信息
if(!$p3->pop_connect()) die("<script language=\"javascript\">location = 'error.php?msg=".urlencode($error_connect)."&sid=$sid&lid=$lid';</script>");
if(!$p3->pop_auth()) die("<script language=\"javascript\">location = 'badlogin.php?sid=$sid&lid=$lid'</script>");
if(!($result = $p3->pop_retr_msg($mnum,$mid,$msize))) die("<script language=\"javascript\">location = 'error.php?msg=".urlencode($error_retrieving)."&sid=$sid&lid=$lid';</script>");
$p3->pop_disconnect();
$sess["headers"][$ix]["read"] = 1;
save_session($sess);
} else
$result = read_file($localname);
} else {
$mysess = $sess["folderheaders"];
$msg = $sess["folderheaders"][$ix];
$filename = $msg["localname"];
if(!file_exists($filename)) die("<script language=\"javascript\">location = 'error.php?msg=".urlencode($error_other)."&sid=$sid&lid=$lid';</script>");
$result = read_file($filename);
$result = $md->set_as($result,1);
save_file($filename,$result);
}
$md->initialize($result);
if($ix > 0) {
// 上一封邮件
$nix = ($ix-1);
$title = htmlspecialchars($mysess[$nix]["subject"]);
$prev_msg = "<a class=\"menu\" href=\"readmsg.php?pag=$pag&folder=".urlencode($folder)."&sid=$sid&lid=$lid&ix=$nix\" title=\"$title\">$previous_text</a>";
}
if($ix < (count($mysess)-1)) {
//下一封邮件
$nix = ($ix+1);
$title = htmlspecialchars($mysess[$nix]["subject"]);
$next_msg = "<a class=\"menu\" href=\"readmsg.php?pag=$pag&folder=".urlencode($folder)."&sid=$sid&lid=$lid&ix=$nix\" title=\"$title\">$next_text</a>";
}
//echo("$prev_msg | $next_msg<br>");
$email = $md->content;
$body = $email["body"];
$body = eregi_replace("<base","<uebimiau_base_not_alowed",eregi_replace("<link","<uebimiau_link_not_alowed",$body));
$body = eregi_replace("<body","<uebimiau_body_not_alowed",$body);
$body = eregi_replace("<style","<uebimiau_style_not_alowed",eregi_replace("</style","</uebimiau_style_not_alowed",$body));
$body = eregi_replace("class=([A-Za-z0-9_\"-]*)","",$body);
$showheaders = ($sh == "true")?1:0;
$ARFrom = $email["from"];
$useremail = $sess["email"];
// 发送邮件的用户名
$name = $ARFrom[0]["name"];
$thismail = $ARFrom[0]["mail"];
$fromreply = "\"$name\" <$thismail>";
$tcontent = eregi_replace("<!--%UM_FROM_LINK%-->","newmsg.php?nameto=".urlencode($name)."&mailto=$thismail&sid=$sid&lid=$lid",$tcontent);
$tcontent = eregi_replace("<!--%UM_FROM_TITLE%-->",htmlspecialchars("$name <$thismail>"),$tcontent);
$tcontent = eregi_replace("<!--%UM_FROM_NAME%-->",htmlspecialchars($name),$tcontent);
// 接收邮件的用户名
$ARTo = $email["to"];
$tobegin = strpos($tcontent,"<!--%UM_TO_LOOP_BEGIN%-->");
$toend = strpos($tcontent,"<!--%UM_TO_LOOP_END%-->")+23;
$tostring = substr($tcontent,$tobegin,$toend-$tobegin);
$toline = substr($tcontent,$tobegin+25,$toend-48-$tobegin);
f