欢迎光临
我们一直在努力

在ASP中用EasyMailObject组件处理Exchange邮件源代码—读取邮件内容和附件(showbody1.asp)

建站超值云服务器,限时71元/月

<%@ language="vbscript" %>
<%
************************************************

这个文件显示邮件的内容和附件
作者:awayeah
邮箱:awayeah@163.net

************************************************
%>

<html>
<head>
<title>读邮件</title>
</head>
<body>
<%
set pop3=session("pop3")
   x = pop3.connect()

   if x <> 0 then
      response.write "连接错误: " + cstr(x)
      pop3.disconnect
   end if
   y = pop3.downloadheaders
   j=pop3.getmessagenumfromid(request.querystring("id"))
   msg = pop3.downloadsinglemessage(j)
   set message object to point to that downloaded message
   set message = pop3.messages(msg)
   显示邮件内容
   response.write replace(message.bodytext,chr(13),"<br>")
  %>
<%
如果该邮件有附件,则显示附件文件名和文件大小
if message.attachments.count>0 then%>   
<p></p>
  <hr>
  <table border=1 align="left" cellspacing="0">
  <tr><td>文件名</td><td>大小</td><tr>
  <%
  for k = 1 to message.attachments.count
  response.write ("<tr><td>")%>
  <a href=# onclick=javascript:window.open(saveatt.asp?msgid=<%=j%>&attid=<%=k%>,getatt,width=600,height=440,scrollbars=yes);>
  <%=message.attachments(k).name%></a></td><td>
  <%response.write cstr(message.attachments(k).size)
  response.write "</td></tr>"
  next
%>
</table>
<%
end if
pop3.disconnect
%>
</body>
</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 在ASP中用EasyMailObject组件处理Exchange邮件源代码—读取邮件内容和附件(showbody1.asp)
分享到: 更多 (0)

相关推荐

  • 暂无文章