精华区 [关闭][返回]

当前位置:月光软件>>讨论区精华>>〖软件开发〗>>● ASP>>★ASP的技巧★>>组件开发及应用>>在ASP中用EasyMailObject组件处理Exchange邮件源代码---读取邮件内

主题:在ASP中用EasyMailObject组件处理Exchange邮件源代码---读取邮件内
发信人: zzdevilfish(章鱼.Net)
整理人: dongbao(2002-04-23 17:25:52), 站内信件
<%@ LANGUAGE="VBSCRIPT" %>
<%
'************************************************

'这个文件显示邮件的内容和附件
'作者:awayeah
'邮箱:[email protected]

'************************************************
%>

<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%></td><td>
  <%Response.Write cstr(Message.Attachments(k).size)
Response.Write "</td></tr>"
  Next
%>
</table>
<%
end if
POP3.Disconnect
%>
</body>
</html>



----
---------------------------------------
本人的[个人版]程序员之路已经开版
太阳品网祝您身体健康,天天有份好心情!
太阳esun评测中心欢迎您!!!
http://www.esun.cc
本人OICQ:264027 E-MAIL:[email protected]   

[关闭][返回]






转载请注明:转载自 月光程序代码网 [ http://www.moon-soft.com ]