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

📄 admin_mail.asp

📁 庐江二中
💻 ASP
字号:
<%PageName="admin_mail"%>
<!--#include file="session.asp"-->
<%checkAdmin2%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="top.asp"--><br>
<table border="1" width="80%" cellspacing="0" cellpadding="1" bgcolor="<%=MainBgColor%>">
  <tr> 
      <td valign=top>
<%
if request("action") = "send" then
	frommail = Trim(Request.Form("frommail"))
	tomail = Trim(Request.Form("tomail"))
	mailsubject = Trim(Request.Form("mailsubject"))
	mailbody = Trim(Request.Form("mailbody"))
	if frommail="" then
	errmsg=errmsg+"<li>发信人不能为空"
	call error()
	Response.End
	end if
	if IsValidEmail(frommail)=false then
	errmsg=errmsg+"<li>发信人Email有错误"
	call error()
	Response.End
	end if
	if mailbody="" then
	errmsg=errmsg+"<li>内容不能为空"
	call error()
	Response.End
	end if	
	if tomail<>"" then
		if IsValidEmail(tomail)=false then
		errmsg=errmsg+"<li>收信人Email有错误"
		call error()
		Response.End
		end if	
		Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
		objCDOMail.From = frommail
		objCDOMail.To = tomail
		objCDOMail.Subject = mailsubject  
		objCDOMail.Body = mailbody   
		objCDOMail.Send
		Set objCDOMail = Nothing
	else
		Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
		objCDOMail.From = frommail
		sql="select Email from users where lockuser=0 and ischecked=1"
		set rs=conn.execute(sql)
		Response.Write("正在邮件群发.................." )
		do while not rs.eof 
			objCDOMail.To = rs(0)
		RS.MoveNext
		Loop
		rs.close
		objCDOMail.Subject = mailsubject  
		objCDOMail.Body = mailbody   
		objCDOMail.Send
		Set objCDOMail = Nothing
	end if
	Response.Write "<script>alert(""发送成功"");location.href=""admin_mail.asp"";</script>"
	Response.End
end if
%>
<form name="sendmail" action="?action=send" method="post" >
        
          <table border="0" cellspacing="1" cellpadding="4" width="100%" align="center" bgcolor="#000000">
            <tr bgcolor="<%=MainTColor%>"> 
              <td height="20" colspan="2" align="center" background="images/admin/b3.gif"><b>发 送 邮 件</b></td>
          </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="25" width="20%" align="right">发信人地址:</td>
              <td height="25" width="80%"> 
                <input type="text" name="frommail" value="<%=frommail%>" size="30">
            </td>
          </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="25" width="20%" align="right">收信人地址:</td>
              <td height="25" width="80%"> 
                <input type="text" name="tomail" size="30">
               为空则发给所有已注册用户</td>
          </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="25" width="20%" align="right">信件标题:</td>
              <td height="25" width="80%"> 
                <input type="text" name="mailsubject" size="50" value="<%=webtitle%>通知">
			  </td>
          </tr>
            <tr bgcolor="#FFFFFF"> 
              <td height="25" width="20%" align="right">信件内容:</td>
              <td height="25" width="80%"> 
                <textarea name="mailbody" cols="60" rows="20"><%=mailbody%></textarea>
                         </td>
          </tr>
          <tr bgcolor="#f6f6f6"> 
            <td height="10" colspan="2" align="center"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              <input type="submit" name="Submit" value="发送">
              <input type="reset" name="Submit" value="取消">
            </td>
          </tr>
        </table>
      </form>
	  </td>
  </tr>
</table>

⌨️ 快捷键说明

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