ใช้ส่วนประกอบ EasyMailObject เพื่อจัดการรหัสที่มาของจดหมายแลกเปลี่ยนใน ASP --- อ่านหัวเรื่องและขนาดจดหมาย (MAILLIST1.ASP)
< %@ language = "vbscript" %>
-
-
'ไฟล์นี้แสดงรายการอีเมลทั้งหมดและตั้งค่าหน้าต่างการแสดงเนื้อหาอีเมลเป็นหน้าต่างว่างเปล่า
'ผู้แต่ง: Awayeah
'อีเมล: [email protected]
-
-
<ภาษาสคริปต์ = vbscript>
parent.frmbottom.location.href = "blank.htm"
sub cmdel_onclick ()
'ลบอีเมล
frmail.submit
สิ้นสุดย่อย
</script>
-
ถ้าเซสชัน ("straccount") = "" หรือเซสชัน ("strpassword") = "" แล้ว
Response.write ("<html> <title> ข้อผิดพลาดยังไม่เข้าสู่ระบบ </title> <body> <p allign = center> <br> <br> คุณยังไม่ได้ลงชื่อเข้าใช้โปรดออกจากระบบก่อน! > <br> ")
Response.write ("<a href = 'login.asp' target = '_ top'> <img src = 'http: //www.newap.net/article/asp/example/2005/logout.jpg' Border = 0 >/a> </p> </body> </html> ")
Response.end
สิ้นสุดถ้า
-
<html>
<head>
<title> รับอีเมล </title>
</head>
<style>
-
A {การตกแต่งข้อความ: ไม่มี}
-
</style>
<body bgcolor = "#008080" text = "#000000">
-
'กำหนดที่อยู่ Mail Server
strserver = เซสชัน ("strserver")
'กำหนดบัญชี
straccount = เซสชัน ("straccount")
'กำหนดรหัสผ่าน
strassword = เซสชัน ("strpassword")
'ตั้งค่าคุณสมบัติต่าง ๆ ของส่วนประกอบ
ตั้งค่า pop3 = createObject ("easymail.pop3.5")
POP3.LicenseKey = "AWA/S19I500R1AX30C0R3100"
pop3.mailserver = strserver
pop3.account = straccount
pop3.password = strpassword
POP3.PreerDredBodyFormat = 1
pop3.timeout = 120
x = pop3.connect
ถ้า x <> 0 แล้ว
Response.write "<p allign = center> ข้อผิดพลาดการเชื่อมต่อ:" + cstr (x) + "<br> <br> กรุณาติดต่อผู้ดูแลระบบ"
POP3.Disconnect
Response.end
สิ้นสุดถ้า
x = pop3.downloadmessages (0)
ถ้า x <> 0 แล้ว
Response.write "ดาวน์โหลดข้อผิดพลาด:" + CSTR (x) + "<br> <br> กรุณาติดต่อผู้ดูแลระบบ"
POP3.Disconnect
Response.end
สิ้นสุดถ้า%>
<p> <br> </p>
<form name = "frmail" action = "mail_prc.asp" method = "post">
<enter>
<table cellpacing = "0" cellpadding = "0" borderColor = "#000080" bgColor = "#fffff">
<tr> <td colspan = 6 allign = "center">
-
'การประมวลผล
ถ้า request.QueryString ("currentPage") = "" แล้ว
cp = 1
อื่น
cp = request.QueryString ("CurrentPage")
สิ้นสุดถ้า
'รับจำนวนอีเมลทั้งหมด
m_count = pop3.messages.count
ถ้า m_count <= 10 แล้ว
pagenum = 1
SD = 1
ed = m_count
อื่น
pagenum = int (m_count/10) +1
ถ้า clng (cp) <> pagenum แล้ว
lastPage = m_count mod 10
sd = (clng (cp) -1)*10+1
ed = clng (cp)*10
อื่น
sd = (clng (cp) -1)*10+1
ed = m_count
สิ้นสุดถ้า
สิ้นสุดถ้า
-
คุณมี <font color = "ff00ff"> <%= pop3.messages.count%> </font> อีเมล </td>
<%เซสชัน ("msgcount") = pop3.messages.count%>
</tr>
<tr>
<td align = "center"> number </td>
<td align = "center"> จาก/ตอบกลับ </td>
<td align = "center"> ธีม </td>
<td align = "center"> วันที่ </td>
<td align = "center"> ขนาด </td>
<td align = "center"> เลือก </td>
</tr>
<%สำหรับ i = sd ถึง ed%>
<tr>
<td align = "center"> <%= i%> </td>
-
fw = "ตอบกลับ:"+แทนที่ (pop3.messages.item (i) .subject, Space (1), "_")
-
<td>
<%receiver = pop3.messages.item (i). จาก%>
<%ถ้า pop3.messages.item (i). fromaddr = "" แล้ว%>
<a href = "">
<%อื่น
-
<a href =#onclick = javaScript: window.open ('sendmail1.asp? addr = <%= pop3.messages.item (i). fromaddr%> & subject = <%= fw%>', 'sendnew', ' ความกว้าง = 600, ความสูง = 480, scrollbars = ใช่ ');>
<%end ถ้า%>
<%ถ้าตัดแต่ง (ตัวรับ) = "" แล้ว
Response.write "Anonymous </a>"%>
<%อื่น%>
<a href =#onclick = javaScript: window.open ('sendmail1.asp? addr = <%= pop3.messages.item (i). fromaddr%> & subject = <%= fw%>', 'sendnew', ' ความกว้าง = 600, ความสูง = 480, scrollbars = ใช่ ');>
<font face = "宋体" size = "2">
<%= pop3.messages.item (i). จาก%> </font>
<%end ถ้า%>
</td>
<td>
<%msgid = pop3.getMessageId (i)%>
<a href = "showbody1.asp? id = <%= msgid%>" target = "frmbottom">
<font face = "宋体" size = "2">
-
ถ้า trim (pop3.messages.item (i) .subject) = "" แล้ว
Response.write "ไม่มีหัวข้อ"
อื่น
Response.write pop3.messages.item (i). subject
สิ้นสุดถ้า
%> </font>
</a> </td>
<td> <font face = "宋体" size = "2"> <%= cdate (mid (cstr (pop3.messages.item (i) .date), 6,11))%> </font> <// td>
<tdwidth = "60"> <font face = "宋体" size = "2"> <%= pop3.messages.item (i) .size%> </font> </td>
<td> <อินพุต type = "ช่องทำเครื่องหมาย" name = "c <%= i%>" value = "<%= i%>"> </td>
</tr>
<%ถัดไป
POP3.Disconnect
-
</table>
</enter>
<p allign = "center"> <อินพุต type = "ปุ่ม" name = "cmdel" value = "delete"> </p>
</form>
<div align = "center">
<table cellpacing = "0" cellpadding = "0" borderColor = "#ff0080" bgcolor = "#fffff">
<tr> <td> หน้า </td>
<%สำหรับ i = 1 ถึง pagenum%>
<td> <a href = "maillist1.asp? currentPage = <%= i%>" target = frmtop> <%= i%> </a> </td>
<%ถัดไป%>
</tr> </table> </div>
</body>
</html>