您现在的位置: 网页吧 > 技术文档 > 网络编程 > ASP专区 > 正文
  • 站内搜索:

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

[作者:网页吧 | 点击数: | 时间:2006-1-21]【
读取邮件内容和附件(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>


在ASP中用EasyMailObject组件处理Exchange邮件源代码(2)网友评论
发表评论
  • 姓 名 :* (必填项)
  • E-mail: QQ:
  • 评 分 : 1分 2分 3分 4分 5分
  • 评论内容:
·请遵守《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。
·用户发表意见仅代表其个人意见,并且承担一切因发表内容引起的纠纷和责任。
·本站管理人员有权在不通知用户的情况下删除不符合规定的评论信息或留做证据。
·请客观的评价您所看到的资讯,提倡就事论事,杜绝漫骂和人身攻击等不文明行为。
网页吧·中国站长第一门户