Processing Exchange Message source code using the Easymailobject component in ASP (2)

Source: Internet
Author: User
Tags count file size mail
Object| source code read message contents and attachments (showbody1.asp)
<%@ language= "VBSCRIPT"%>
<%
'************************************************

' This file displays the contents and attachments of the message
' Author: Awayeah
' E-mail: awayeah@163.net

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

<title> Read Mail </title>
<body>
<%
SET pop3=session ("POP3")
x = POP3. Connect ()

If x <> 0 Then
Response.Write "Connection Error:" + CStr (x)
POP3. Disconnect
End If
y = POP3. Downloadheaders
J=pop3. Getmessagenumfromid (Request.QueryString ("id"))
msg = POP3. Downloadsinglemessage (j)
' Set message Object to "to" downloaded message
Set message = POP3. Messages (msg)
' Show message content
Response.Write Replace (MESSAGE.BODYTEXT,CHR), <br>
%>
<%
' If the message has an attachment, the attachment file name and file size are displayed
If message. Attachments.count>0 then%>
<P></p>
<table border=1 align= "left" cellspacing= "0" >
<tr><td> filename </td><td> size </td><tr>
<%
For k = 1 to message. Attachments.count
Response.Write ("<tr><td>")%>
<a href=# onclick=javascript:window.open (' saveatt.asp@msgid=<_25=j_25>&attid=<_25=k_25> ', ' 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>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.