用EasyMailObject组件处理Exchange邮件源代码(4)
程序员文章站
2023-08-29 17:35:31
在asp中用easymailobject处理exchange邮件源代码---删除邮件时调用的文件(mail_prc.)<%@ language=vbscript %><%*****...
在asp中用easymailobject处理exchange邮件源代码---删除邮件时调用的文件(mail_prc.)
<%@ language=vbscript %>
<%
*************************************
这个文件是删除邮件时调用的
作者:awayeah
邮箱:awayeah@163.net
*************************************
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 "maillist1.asp"
end if
cc1=left(cc1,len(cc1)-1)
dim arr
arr=split(cc1,",")
set pop3 = createobject("easymail.pop3.5")
pop3.account=session("straccount")
pop3.password=session("strpassword")
pop3.mailserver = "192.9.200.89"
pop3.licensekey = "awa/s19i500r1ax30c0r3100"
x = pop3.connect()
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 "<p align=center><br><br>删除邮件发生错误( " + cstr(x) + ").请与管理员联系.<br><br>"
response.write "<a href=maillist1.asp>返回</a></p>"
pop3.disconnect
response.end
else
response.write "message deleted successfully."
response.write ""
pop3.disconnect
end if
next
pop3.disconnect
response.redirect "maillist1.asp"
%>
<html>
<head>
<meta name="generator" content="microsoft visual studio 6.0">
</head>
<body>
</body>
</html>
<%@ language=vbscript %>
<%
*************************************
这个文件是删除邮件时调用的
作者:awayeah
邮箱:awayeah@163.net
*************************************
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 "maillist1.asp"
end if
cc1=left(cc1,len(cc1)-1)
dim arr
arr=split(cc1,",")
set pop3 = createobject("easymail.pop3.5")
pop3.account=session("straccount")
pop3.password=session("strpassword")
pop3.mailserver = "192.9.200.89"
pop3.licensekey = "awa/s19i500r1ax30c0r3100"
x = pop3.connect()
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 "<p align=center><br><br>删除邮件发生错误( " + cstr(x) + ").请与管理员联系.<br><br>"
response.write "<a href=maillist1.asp>返回</a></p>"
pop3.disconnect
response.end
else
response.write "message deleted successfully."
response.write ""
pop3.disconnect
end if
next
pop3.disconnect
response.redirect "maillist1.asp"
%>
<html>
<head>
<meta name="generator" content="microsoft visual studio 6.0">
</head>
<body>
</body>
</html>
上一篇: Redis在.net 环境下的使用
推荐阅读
-
用EasyMailObject组件处理Exchange邮件源代码(5)
-
用EasyMailObject组件处理Exchange邮件源代码(6)
-
用EasyMailObject组件处理Exchange邮件源代码(4)
-
用EasyMailObject组件处理Exchange邮件源代码(7)
-
用EasyMailObject组件处理Exchange邮件源代码(1)
-
用EasyMailObject组件处理Exchange邮件源代码(3)
-
在ASP中用EasyMailObject组件处理Exchange邮件源代码(1)
-
在ASP中用EasyMailObject组件处理Exchange邮件源代码(2)
-
用EasyMailObject组件处理Exchange邮件源代码(3)
-
用EasyMailObject组件处理Exchange邮件源代码(1)