📄 admin_sendmail.asp
字号:
<%@language=vbscript codepage=936 %>
<%
'=========================================================
'产品目录:风讯产品N系列
'软件名称:风讯站点管理系统
'当前版本:2004.I.0225
'最新更新:2004.2.10
'=========================================================
'Copyright (C) 2002-2004 cooin.com. All rights reserved.
'网站: http://www.cooin.com Foosun.net
'程序制作:轻风云(QQ:655071)
'Email:skeen@cooin.com,skeen@Foosun.net
'论坛支持:风讯在线论坛(http://bbs.cooin.com http://bbs.foosun.net)
'=========================================================
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=0
Const PurviewLevel_Others="MailList"
%>
<!--#include file="conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="Admin_checkmana.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="admin_EnPas.asp" -->
<%
dim sql,rs,Action,FoundErr,ErrMsg
dim JMObjInstalled
Action=trim(request("Action"))
JMObjInstalled=IsObjInstalled("JMail.Message")
dim FSObjInstalled
FSObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
%>
<html>
<head>
<title>注册用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<%
if Action="Send" then
call SendMaillist()
elseif Action="maildb" then
call mailoutdb()
elseif Action="mailtxt" then
call mailouttxt()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
sub main()
%>
<form method="POST" action="">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#7ED3A7" Class="border">
<tr bgcolor="#F7FFF4" class="title">
<td height="22" colspan=2 align=center class="title"><b> </b>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/bg1.gif">
<tr>
<td height="26"> <div align="center"><b>邮 件 列 表 </b><a href="Admin_Sendmail.asp"><font color="#FF0000">发送邮件列表</font></a>
| <a href="Admin_Sendmail.asp?Action=Export"><font color="#FF0000">导出邮件列表</font></a>
</div></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#F7FFF4" class="tdbg">
<td rowspan="3" align="right">收件人:</td>
<td width="85%">
<input type="radio" name="incepttype" value="1" checked>
按用户类型发送邮件
<select name="inceptusertype" id="usertype">
<option value="0" selected>全部用户</option>
<option value="1">一般用户</option>
<option value="2">高级用户</option>
<option value="3">认证用户</option>
<option value="4">VIP 用户</option>
<option value="5">系统管理员</option>
</select>
</td>
</tr>
<tr class="tdbg">
<td width="85%" bgcolor="#F7FFF4">
<input type="radio" name="incepttype" value="2">
按用户姓名发送邮件 <input name="Username" type="text" id="Username" size="40">
多个用户名请用<font color="#0000FF">英文的逗号</font>分隔。</td>
</tr>
<tr class="tdbg">
<td width="85%" bgcolor="#F7FFF4">
<input type="radio" name="incepttype" value="3">
按用户Email发送邮件
<input name="email" type="text" id="email" size="40">
多个用户Email请用<font color="#0000FF">英文的逗号</font>分隔。</td>
</tr>
<tr bgcolor="#F7FFF4" class="tdbg">
<td width="15%" align="right">邮件主题:</td>
<td width="85%">
<input type=text name=subject size=64>
</td>
</tr>
<tr bgcolor="#F7FFF4" class="tdbg">
<td align="right">邮件内容:</td>
<td>
<textarea cols=80 rows=8 name="content"></textarea>
</td>
</tr>
<tr bgcolor="#F7FFF4" class="tdbg">
<td width="15%" align="right">发件人:</td>
<td width="85%">
<input type="text" name="sendername" size="64" value="<%=Computerc%>">
</td>
</tr>
<tr bgcolor="#F7FFF4" class="tdbg">
<td width="15%" align="right">发件人Email:</td>
<td width="85%">
<input type="text" name="senderemail" size="64" value="<%=mailtoo%>">
</td>
</tr>
<tr bgcolor="#F7FFF4" class="tdbg">
<td align="right">邮件优先级:</td>
<td>
<input type="radio" name="Priority" value="1">
高
<input type="radio" name="Priority" value="3" checked>
普通
<input type="radio" name="Priority" value="5">
低</td>
</tr>
<tr bgcolor="#F7FFF4" class="tdbg">
<td width="15%" align="right">注意事项:</td>
<td width="85%">
<%
If JMObjInstalled=false Then
Response.Write "<b><font color=red>对不起,因为服务器不支持 JMail组件! 所以不能使用本功能。</font></b>"
else
Response.Write "信息将发送到所有注册时完整填写了信箱的用户,邮件列表的使用将消耗大量的服务器资源,请慎重使用。"
End If
%>
</td>
</tr>
<tr bgcolor="#F7FFF4" class="tdbg">
<td colspan=2 align=center>
<input name="Action" type="hidden" id="Action" value="Send">
<input name="Submit" type="submit" id="Submit" value=" 发 送 " <% If JMObjInstalled=false Then response.write "disabled" end if%>>
<input name="Reset" type="reset" id="Reset2" value=" 清 除 ">
</td>
</tr>
</table>
</form>
<%
end sub
sub SendMaillist()
dim Sendername,Senderemail,Subject,Content,Priority,InceptType,InceptUserType,InceptName,InceptEmail,i,j
Sendername=trim(request("sendername"))
Senderemail=trim(request("senderemail"))
Subject=trim(request("Subject"))
Content=trim(request("Content"))
Priority=trim(request("Priority"))
if Sendername="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>发件人不能为空!</li>"
end if
if Senderemail="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>发件人Email不能为空!</li>"
end if
if Subject="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>邮件主题不能为空!</li>"
end if
if Content="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>邮件内容不能为空!</li>"
end if
if Priority="" then
Priority=3
end if
InceptType=Clng(request("incepttype"))
set rs=server.createobject("adodb.recordset")
sql="select * from admin"
if InceptType=1 then
InceptUserType=request("inceptusertype")
if InceptUserType<>0 then
sql=sql & " where level =" & InceptUserType & ""
end if
elseif InceptType=2 then
InceptName=replace(replace(replace(replace(request("inceptname")," ",""),"'",""),chr(34),""),"|","','")
sql=sql & " where username in ('" & username & "')"
elseif InceptType=3 then
InceptEmail=replace(replace(replace(replace(request("inceptemail")," ",""),"'",""),chr(34),""),"|","','")
sql=sql & " where email in ('" & email & "')"
end if
if FoundErr=True then
exit sub
end if
rs.open sql,Conn,1,1
if rs.bof and rs.eof then
FoundErr=true
ErrMsg=ErrMsg & "<br><li>暂时没有用户注册!</li>"
else
response.write "<li>正在发送中,请等待 "
do while not rs.eof
if IsValidEmail(rs(Email))=true then
ErrMsg=SendMail(rs(Email),rs(userName),Subject,Content,Sendername,Senderemail,Priority)
if ErrMsg<>"" then
FoundErr=True
exit sub
end if
i=i+1
response.write "."
else
j=j+1
end if
rs.movenext
loop
response.write "<BR><li>成功发送邮件:"&i&"封"
if j>0 then response.write "<BR><li>未发送邮件:"&j&"封(邮件地址错误)。" end if
end if
rs.close
set rs=nothing
call CloseConn()
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -