当前位置: 移动技术网 > IT编程>开发语言>.net > 用EasyMailObject组件处理Exchange邮件源代码(2)

用EasyMailObject组件处理Exchange邮件源代码(2)

2018年10月12日  | 移动技术网IT编程  | 我要评论

自定义英雄1.87攻略,智能,刘玉璞

在asp中用easymailobject处理exchange邮件源代码---读取邮件内容和附件(showbody1.)

<%@ 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>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网