⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_email.asp

📁 后台登陆admin.asp
💻 ASP
字号:
<!--#include file="mdb.asp"-->
<%Admin="System"%>
<!--#include file="check.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/format.asp"-->
<HTML><HEAD><TITLE>管理中心——发送邮件</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="inc/admin.css" type=text/css rel=StyleSheet>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey))>
<%

'****************************************************
if session("adminlogin")<>sessionvar then
  Response.Write("<script language=javascript>alert('您尚未登陆或登陆超时,请重新登陆!!');this.top.location.href='admin.asp';</script>")
  response.end
end if
%>
<% 
if Request.QueryString("action")="qdo" then
q_title=CheckStr(request.form("q_title"))
q_content=CheckStr(request.form("q_content"))
if q_title="" then
errornum=1
errormsg=errormsg&"<li>标题不能为空</li>"
end if
if q_content="" then
errornum=1
errormsg=errormsg&"<li>内容不能为空</li>"
end if
if errornum=1 then
call error("错误信息",errormsg)
response.end
end if
emailtopic=q_title  
   emailbody=""&vbCrlf&"亲爱的"&q_username&", 您好!"
   emailbody=emailbody & ""&vbCrlf&""&vbCrlf&"这是《"&webname&"》发送给您的邮件!内容如下:"&vbCrlf&""&vbCrlf&""
   emailbody=emailbody & q_content
   emailbody=emailbody &""&vbCrlf&""&vbCrlf&"====================================="
   emailbody=emailbody & ""&vbCrlf&""&vbCrlf&"本站地址:"&weburl
sql2="select email from [user]"
set rs2=conn.execute(sql2)
if not (rs2.eof or rs2.bof) then
do while not rs2.eof
if IsValidEmail(rs2("email"))=true then
i=0
emaito=rs2("email")%>
<!-- #include file="inc/email_inc.asp" -->
<%if SendMail<>"OK" then exit do 
end if
rs2.movenext
i=i+1
loop
rs2.close
set rs2=nothing
end if
	if SendMail="OK" then
		sendmsg="邮件发送成功,共发送"&i&"封邮件<br>"
	else
		sendmsg=sendmsg&"很抱歉,由于系统错误,发送失败<br>"
	end if
call error("操作信息",sendmsg)
response.end
end if
%>
<% if Request.QueryString("action")="ddo" then
d_title=CheckStr(request.form("d_title"))
d_content=CheckStr(request.form("d_content"))
emailto=CheckStr(request.form("d_email"))
d_username=CheckStr(request.form("d_username"))
if d_username="" then
errornum=1
errormsg=errormsg&"<li>接收人不能为空</li>"
end if
if emailto="" then
errornum=1
errormsg=errormsg&"<li>email不能为空</li>"
end if
if IsValidEmail(emailto)=false then
errornum=1
errormsg=errormsg&"<li>email格式不对</li>"
end if
if d_content="" then
errornum=1
errormsg=errormsg&"<li>内容不能为空</li>"
end if
if errornum=1 then
call error("错误信息",errormsg)
response.end
end if
emailtopic=d_title
   emailbody=""&vbCrlf&"亲爱的"&d_username&", 您好!"
   emailbody=emailbody & ""&vbCrlf&""&vbCrlf&"这是《"&webname&"》发送给您的邮件!内容如下:"&vbCrlf&""&vbCrlf&""
   emailbody=emailbody & d_content
   emailbody=emailbody &""&vbCrlf&""&vbCrlf&"====================================="
   emailbody=emailbody &""&vbCrlf&"本站地址:"&weburl
%>
<!-- #include file="inc/email_inc.asp" -->
<%
        if SendMail="OK" then
		sendmsg="邮件发送成功<br>"
	else
		sendmsg=sendmsg&"很抱歉,由于系统错误,发送失败<br>"
	end if
call error("操作信息",sendmsg)
response.end
end if

sub error(errortite,errormsg)
response.write "<table cellpadding=0 cellspacing=0 border=0  width=""100%"" align=center>"&_
		"<tr><td><table cellpadding=3 cellspacing=1 border=0 width=""100%""><tr align=center>"&_
		"<td width=""100%""><b>"+errortite+"</b></td>"&_
		"</tr><tr><td width=""100%"">"&_
		"<b>提示:</b><br><br>"&_
		""&errormsg&" </td></tr><tr align=center><td width=""100%"">"&_
		"<a href=javascript:history.go(-1)> << 返 回</a>"&_
		"</td></tr></table></td></tr></table>"
end sub
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
<form name="form1" method="POST" action="?action=qdo" >
   <tr class=Hxcmsss> 
      <td colspan="2" height=22>群发邮件</td>
    </tr>
    <tr class=Hxcmsds> 
      <td align="right" width="20%">邮件主题:</td>
      <td> 
        <input type="text" name="q_title" size="30" >
      </td>
    </tr>
    <tr class=Hxcmsds> 
      <td align="right" width="20%">邮件内容:</td>
      <td> 
        <textarea rows="4" name="q_content" cols="50"></textarea>
      </td>
    </tr>
    <tr class=Hxcmsqs>
      <td width="20%" align="right"> </td> 
      <td> 
        &nbsp;<input type="submit" name="Submit" value="提 交" class="button">
        <input type="reset" name="Submit2" value="重 置" class="button">
      </td>
    </tr>
    <tr class=Hxcmsqs>
      <td align="center" width="20%" colspan="2">
      信息将发送到所有注册时完整填写了信箱的用户,群发邮件的使用将消耗大量的服务器资源,请慎用。
      </td>
    </tr>
  </table>
  </div>
  </form>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
 <form name="form1" method="POST" action="?action=ddo" >
    <tr class=Hxcmsss> 
      <td colspan="2" height=22>单发邮件</td>
    </tr>
    <tr class=Hxcmsds>
      <td align="right" width="20%">接收人:</td>
      <td> 
        <input type="text" name="d_username" size="30" >
      </td>
    </tr>
    <tr class=Hxcmsds> 
      <td align="right" width="20%">接收人email:</td>
      <td class=cpb_td_bgcolor2> 
        <input type="text" name="d_email" size="30" >
      </td>
    </tr>
    <tr class=Hxcmsds> 
      <td align="right" width="20%">邮件主题:</td>
      <td> 
        <input type="text" name="d_title" size="30" >
      </td>
    </tr>
    <tr class=Hxcmsds> 
      <td align="right" width="20%">邮件内容:</td>
      <td> 
        <textarea rows="4" name="d_content" cols="50"></textarea>
      </td>
    </tr>
    <tr class=Hxcmsqs> 
      <td width="20%" align="right"> </td>
      <td> 
        &nbsp;<input type="submit" name="Submit" value="提 交" class="button">
        <input type="reset" name="Submit2" value="重 置" class="button">
      </td>
    </tr>
    <tr class=Hxcmsqs>
      <td align="right" width="20%" colspan="2">
      <p align="center">信息将发送到您想发送的邮箱</td></tr>
  </table>
</body>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -