频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

为imail和Mdaemon设计Webmail---删除邮件调用的文件(mail_prc.asp)

来源: 作者: 出处:巧巧读书 2007-10-06 进入讨论组
imail和Mdaemon设计Webmail---删除邮件调用的文件(mail_prc.asp)
<%@ Language=VBScript %>
<%
'*********************************

'这是删除邮件所调用的文件,按http://www.knowsky.com/maillist1.asp中选定的邮件ID进行删除

'*********************************

'以下代码把选中的邮件ID放入数组
dim cc,cc1,sep,dd
msgcount = session("msgcount")
sep=","
for i=1 to msgcount
dd="c"+cstr(i)
msgid=cstr(Request.Form (dd))
if msgid="" then
cc1=cc1+msgid
else
cc1=cc1+msgid+sep
end if
next

if len(cc1)=0 then
Response.Redirect "http://www.knowsky.com/maillist1.asp"
end if

cc1=left(cc1,len(cc1)-1)
'response.write cc1
dim arr
'上面把邮件ID保存成“1,2,3,4,5”的格式,再用split函数存入数组
arr=split(cc1,",")
'*********************************************

Set POP3 = CreateObject("EasyMail.POP3.5")
pop3.account=session("straccount")
pop3.password=session("strpassword")
POP3.MailServer = session("strserver")
POP3.LicenseKey = "awa/S19I500R1AX30C0R3100"

x = POP3.Connect()
If x <> 0 Then
Response.Write "连接错误(" + CStr(x) + ")请与管理员联系."
Response.Write "返回

"
POP3.Disconnect
Response.End
End If

for i=0 to ubound(arr) '按数组下标进行循环
arr(i)=clng(arr(i))
y = POP3.DownloadHeaders

x = POP3.DeleteSingleMessage(arr(i)) '删除邮件

If x <> 0 Then
Response.Write "



删除邮件发生错误( " + CStr(x) + ").请与管理员联系.

"
Response.Write "返回

"
POP3.Disconnect
Response.End
Else
'Response.Write "Message deleted successfully."
'Response.Write ""
'POP3.Disconnect
End If

next
pop3.disconnect
Response.Redirect "http://www.knowsky.com/maillist1.asp"
%>






更多文章 更多内容请看IMail服务器邮件服务器专题其他电子邮件服务器专题,或进入讨论组讨论。
更多专题 【深 度 阅 读】 相 关 文 章
    收藏此文】【 】【打印】【关闭
    相关图文阅读
    频道图文推荐
    健 康 咨 询
    时 尚 咨 询
    巧巧读书宗旨
    相关专题
    讨论组问题推荐
    站内各频道最新更新文档
    站内最新制作专题
    热门关键字导读
    Photoshop教 程照片处理 照片制作 PS快捷键 抠图
    计 算 机 故 障XP系统修复
    艺 术 与 设 计设计 流媒体 设计欣赏 边框
    计 算 机 安 全ARP
    站内频道文章精选