Use the Easymailobject component in ASP to process Exchange message source code---Read message contents and attachments (
Source: Internet
Author: User
<%@ 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=<%=j%>&attid=<%=k%> ', ' Getatt ', ' Width=600,height=440,scrollbars=yes ');>
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