答案:<%@ LANGUAGE="VBSCRIPT" %>
<%
'*********************************'这是邮件列示窗口,列出所有邮件的发件人、主题、日期、大小等
'*********************************
%><script language=vbscript>
'把邮件内容显示窗口置为空窗口
parent.frmbottom.location.href=>sub cmdel_onClick()
frmail.submit
end sub
</script><html>
<head>
<title>收邮件</title>
</head>
<STYLE>
<!--
A{text-decoration:none}
-->
</STYLE>
<body bgcolor="#008080" text="#000000">
<%strserver=session("strserver")
strAccount=session("straccount")
strPassword=session("strpassword")
Set POP3 = CreateObject("EasyMail.POP3.5")
POP3.LicenseKey = "awa/S19I500R1AX30C0R3100"
POP3.MailServer = strServer
POP3.Account = straccount
POP3.Password = strpassword
'设置邮件内容显示格式
pop3.PreferredBodyFormat=1
pop3.TimeOut=300
'连接
x = POP3.Connect
If x <> 0 Then
Response.Write "<p align=center>连接错误: " + CStr(x) + "<br><br>请和管理员联系"
POP3.Disconnect
Response.End
End If
'下载邮件信息
x = POP3.DownloadMessages(0)
If x <> 0 Then
Response.Write "下载错误: " + CStr(x) +"<br><br>请和管理员联系"
POP3.Disconnect
Response.End
End If%>
<p><br></p><form name="frmail" action="mail_prc.asp" method="POST">
<div align="center">
<table border="1" width="98%" cellspacing="0" cellpadding="0" bordercolor="#000080" bgcolor="#FFFFFF">
<tr><td colspan=6 align="center">
你有<font color="ff00ff"><%=POP3.Messages.Count%></font>封邮件。</td>
<%session("msgcount")=POP3.Messages.Count%>
</tr>
<tr>
<td align="center"> </td>
<td align="center">来自/回复</td>
<td align="center">主题</td>
<td align="center">日期</td>
<td align="center" width=40>大小</td>
<!--<td width="30"><font face="宋体" size="2">删除</font></td>-->
<td align="center">选</td>
</tr>
<%'循环显示所有邮件
for i=pop3.messages.count to 1 step -1
%><tr>
<td align="center"><%if POP3.Messages.item(i).attachments.count>0 then '如果这个邮件有附件则显示带附件的图标
Response.Write "<img src='http://www.zzzyk.com/article/Article/icon/attach.gif' border=0>"
else
Response.Write "<img src='http://www.zzzyk.com/article/Article/icon/mail.gif' border=0>"
end if
%></td>
<%
fw="回复:"+replace(POP3.messages.item(i).subject,space(1),"_")
%>
<td>
<%receiver=POP3.Messages.item(i).from
if POP3.Messages.item(i).fromaddr="" then%>
<a href=><%else
%>
<a href=><%end if%>
<%if trim(receiver)="" then
response.write "匿 名</a>"%>
<%else%>
<a href=><font face="宋体" size="2">
<%=POP3.Messages.item(i).From%></font>
<%end if%>
</td>
<td>
<%msgid=POP3.GetMessageID(i) '取得邮件ID%>
<a href=><font face="宋体" size="2">
<%'显示邮件主题
if trim(POP3.messages.item(i).Subject)="" then
response.write "无主题"
else
response.write POP3.messages.item(i).Subject
end if
%></font>
</a></td><td><font face="宋体" size="2"><%=POP3.messages.item(i).date%></font></td>
<td><font face="宋体" size="2"><%=POP3.messages.item(i).size%></font></td>
<td><input type="checkbox" name="c<%=i%>" value="<%=i%>"></td>
</tr>
<%next
POP3.Disconnect
' Set POP3 = Nothing
%>
</table>
</div>
<p align="center"><input type="button" name="cmdel" value="删除"></p>
</form>
</body>
</html>
上一个:网管助手:DameWare NT Utilities
下一个:为imail和Mdaemon设计Webmail---读取邮件内容(showbody1.asp)