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>