为imail和Mdaemon设计Webmail---读取邮件信息(maillist1.asp)
- 2007-05-03 15:48:27 作者:21eok 来源:岚山夜话 浏览次数:1058 文字大小:【大】【中】【小】
'********************************* '这是邮件列示窗口,列出所有邮件的发件人、主题、日期、大小等 '********************************* %> <script language=vbscript> '把邮件内容显示窗口置为空窗口 parent.frmbottom.location.href="http://www.5dmail.net/html/2004-1-7/blank.htm" 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.5dmail.net/html/2004-1-7/icon/attach.gif' border=0>" else Response.Write "<img src='http://www.5dmail.net/html/2004-1-7/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=# onClick=javascript:window.open('sendmail1.asp?addr=<%=pop3.messages.item(i).fromaddr%>&subject=<%=fw%>','sendnew','width=600,height=480,scrollbars=yes');> <%end if%> <%if trim(receiver)="" then response.write "匿 名</a>"%> <%else%> <a href=# onClick=javascript:window.open('sendmail1.asp?addr=<%=pop3.messages.item(i).fromaddr%>&subject=<%=fw%>','sendnew','width=600,height=480,scrollbars=yes');> <font face="宋体" size="2"> <%=POP3.Messages.item(i).From%></font> <%end if%> </td> <td> <%msgid=POP3.GetMessageID(i) '取得邮件ID%> <a href="showbody1.asp?id=<%'=msgid%><%=i%>" target="frmbottom"> <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>
»最新资源下载
|