在ASP中用EasyMailObject组件处理Exchange邮件源代码---读取邮件内容和附件(

作者:袖梨 2022-06-30
<%@ LANGUAGE="VBSCRIPT" %>
<%
'************************************************
'这个文件显示邮件的内容和附件
'作者:awayeah
'邮箱:[email protected]
'************************************************
%>


读邮件


<%
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),"
")
    %>
<%
'如果该邮件有附件,则显示附件文件名和文件大小
if message.Attachments.Count>0 then%>     


    

    
    
    <%
    For k = 1 To message.Attachments.Count
    Response.Write ("
文件名大小
")%>
    &attid=<%=k%>','getatt',',,scrollbars=yes');>

相关文章

精彩推荐

一聚教程网

Copyright © 2010-2022

111cn.net All Rights Reserved