ใช้ส่วนประกอบ EasyMailObject เพื่อประมวลผลซอร์สโค้ดอีเมลใน ASP-อ่านเนื้อหาและไฟล์แนบ (showbody1.asp)
< %@ language = "vbscript" %>
-
-
'ไฟล์นี้แสดงเนื้อหาและไฟล์แนบของอีเมล
'ผู้แต่ง: Awayeah
'อีเมล: [email protected]
-
-
<html>
<head>
<title> อ่านอีเมล </title>
</head>
<body>
-
SET POP3 = เซสชัน ("POP3")
x = pop3.connect ()
ถ้า x <> 0 แล้ว
Response.write "ข้อผิดพลาดการเชื่อมต่อ:" + CSTR (x)
POP3.Disconnect
สิ้นสุดถ้า
y = pop3.downloadheaders
j = pop3.getMessagenumFromid (request.QueryString ("id"))
msg = pop3.downloadsinglemessage (j)
'ตั้งค่าวัตถุข้อความเพื่อชี้ไปที่ข้อความที่ดาวน์โหลด
Set Message = POP3.Messages (MSG)
'แสดงเนื้อหาอีเมล
Response.write แทนที่ (message.bodytext, Chr (13), "<br>")
-
-
'หากข้อความมีไฟล์แนบชื่อไฟล์ไฟล์แนบและขนาดไฟล์จะปรากฏขึ้น
ถ้า message.attachments.count> 0 แล้ว%>
<p> </p>
<Hr>
<table border = 1 allign = "left" cellpacing = "0">
<tr> <td> ชื่อไฟล์ </td> <td> ขนาด </td> <tr>
-
สำหรับ k = 1 ถึง message.attachments.count
Response.write ("<tr> <td>")%>
<a href =# onclick = javaScript: window.open ('saveatt.asp? msgid = <%= j%> & attid = <%= k%>', 'getatt', 'ความกว้าง = 600, ความสูง = 440, scrollbars = ใช่ ');>
<%= message.attachments (k) .name%> </a> </td> <td>
<%response.write cstr (message.attachments (k) .size)
Response.write "</td> </tr>"
ต่อไป
-
</table>
-
สิ้นสุดถ้า
POP3.Disconnect
-
</body>
</html>