【php开源代码栏目提醒】:网学会员--在 php开源代码编辑为广大网友搜集整理了:lookmail.php绩等信息,祝愿广大网友取得需要的信息,参考学习。
<?php session_start();
$hostname=$_SESSION[host];
$username=$_SESSION[user];
$userpwd=$_SESSION[pwd];
if(!$mbox=@imap_open("$hostname","$username","$userpwd")){
echo "<script>alert('登录超时,请重新登录!');history.back();</script>";
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>收取邮件</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-image: url(images/mrbg.gif);
}
-->
</style>
</head>
<body>
<table width="604" border="00" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="135" height="421" valign="top">
<?php
include("mail_left.php");
?> </td>
<td width="454" align="center" valign="top"><table width="454" height="421" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="35"><img src="images/mail_04.gif" width="454" height="35"></td>
</tr>
<tr>
<td width="454" height="29" background="images/mail_07.gif"> <span class="STYLE22"><?php echo $lmbs;?></span></td>
</tr>
<tr>
<td align="center" valign="top">
<form action="delmail.php" method="post" name="form1" id="form1">
<table width="454" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="454" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#CCFF33">
<td width="44" height="25" align="center" bgcolor="#FAFCFF"><div align="center" class="STYLE1">选择</div></td>
<td width="115" height="25" bgcolor="#FAFCFF"><div align="center" class="STYLE1 style2">邮件主题</div></td>
<td width="127" bgcolor="#FAFCFF"><div align="center" class="STYLE1 style2">发件人</div></td>
<td width="114" bgcolor="#FAFCFF"><div align="center" class="STYLE1 style2">发件时间</div></td>
<td width="54" bgcolor="#FAFCFF"><div align="center" class="STYLE1 style2">大小</div></td>
</tr>
<?php
$check = imap_check($mbox);
$sum=$check->Nmsgs;
print_r(imap_search($mbox,"SEEN"));
if($sum<=0){
?>
<tr>
<td height="25" colspan="5" align="center">暂无邮件</td>
</tr>
<?php
}else{
if($_GET[page]=="" || is_numeric($_GET[page]==false)){
$page=1;
}else{
$page=$_GET[page];
}
$pagesize=10;
if($sum%$pagesize==0){
$totalpage=$sum/$pagesize;
}else{
$totalpage=ceil($sum/$pagesize);
}
$frompage=($page-1)*$pagesize+1; //获取每页的第一条记录
$topage=$frompage+$pagesize; //获取每页的最后一条记录
if(($sum-$topage)<0){
$topage=$sum+1;
}
for($i=$frompage;$i<$topage;$i++){
$obj=imap_headerinfo($mbox,$i);
?>
<tr>
<td height="25" bgcolor="#FFFFFF"><div align="center">
<input type="checkbox" name="<?php echo $i;?>2" value="<?php echo $i;?>" />
</div></td>
<td height="25" bgcolor="#FFFFFF"><div align="left"> <a href="indexs.php?lmbs=查看邮件&id=<?php echo $i?>" class="a1">
<?php
if(strtolower(substr($obj->Subject,0,10))==strtolower("=?gb2312?B"))
echo base64_decode(substr($obj->Subject,11,(strlen($obj->Subject)-13)));
else
echo $obj->Subject;
?>
</a></div></td>
<td bgcolor="#FFFFFF"><div align="center"><?php echo ($obj->fromaddress);?></div></td>
<td bgcolor="#FFFFFF"><div align="center">
<?php
$array=getdate(strtotime($obj->date));
echo $array[year]."-".$array[mon]."-".$array[mday]." ".$array[hours].":".$array[minutes];
?>
</div></td>
<td bgcolor="#FFFFFF"><div align="center">
<?php
$size=$obj->Size;
if($size>=1024)
{
echo number_format(($size/1024),2)." KB";
}
elseif($size>1024*1024)
{
echo number_format(($size/(1024*1024)),2)." M";
}
elseif($size>1024*1024*1024)
{
echo number_format(($size/(1024*1024*1024)),2)." G";
}
elseif($size<1024)
{
echo ($size)." 字节";
}
?>
</div></td>
</tr>
<?php
}
?>
</table>
<table width="454" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#EEEEEE">
<td width="50" align="center">
<input name="submit2" type="submit" class="buttoncss" value="删除" /></td>
<td width="374"><div align="left">共有邮件 <?php echo $sum;?> 封 每页显示 <?php echo $pagesize;?> 封 (第 <?php echo $page;?> 页/共 <?php echo $totalpage