在asp中用easymailobject组件处理exchange邮件源代码---读取邮件内容和附件(showbody1.asp)
<%@ 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>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器