• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

为imail和Mdaemon设计Webmail---读取邮件内容(showbody1.asp)

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: 互连网

软件测试论坛讨论

领测软件测试网 <%@ LANGUAGE="VBSCRIPT" %>
<%
'*********************************


'这是显示邮件内容窗口的文件,根据邮件列示窗口(maillist1.asp)传来的邮件ID来显示所选的邮件


'*********************************
%>
<html>
<head>
<title>读邮件</title>
</head>
<body>
<%
i=clng(Request.QueryString("id")) '要显示邮件的ID
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


Response.Write replace(POP3.Messages.item(i).bodytext,chr(13),"<br>") '显示邮件正文
Response.Write "<hr>"


if pop3.messages.item(i).Attachments.Count>0 then '如果该邮件有附件
%>
<P></p>
<table border=1 align="left" cellspacing="0">
<tr><td>文件名</td><td>大小</td><tr>
<%
For k = 1 To pop3.messages.item(i).Attachments.Count '按附件数循环显示所有附件名
Response.Write ("<tr><td>")%>
<a href=# onClick=javascript:window.open('saveatt.asp?msgid=<%=i%>&attid=<%=k%>','getatt','width=640,height=480,scrollbars=yes');>
<%=pop3.Messages.item(i).Attachments(k).name%></a></td><td>
<%Response.Write cstr(pop3.Messages.item(i).Attachments(k).size)
Response.Write "</td></tr>"
Next
%>
</table>
<%
end if
POP3.Disconnect
' Set POP3 = Nothing
%>
</body>
</html>

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网