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

📄 sendmail.asp

📁 都市星空BBS系统 v1.1(SQL)
💻 ASP
字号:
<%
'==============================================================================
'软件名称:星空社区 VER 1.0.15
'当前版本:starcity club V1.0.15
'最新更新:2004.9
'==============================================================================
'Copyright (C) 2002-2004 Googln.com  All rights reserved.
'商业注册联系:010-64410364
'技术支持QQ:6370639(限商业用户) 
'程序开发:Googln Studio(BeiJing)
'Email:Avram@163.com
'论坛支持:星空社区(http://www.starcity.cn/bbs)
'官方网站:www.Googln.com  演示站点:www.starcity.cn/bbs  都市星空:www.starcity.cn 阳光商城:www.sunmall.com.cn
'==============================================================================
'免费版本请在首页保留版权信息,并做上本站LOGO友情连接
'都市星空在线保留此程序的法律追究权利
'==============================================================================
%>
<!--#include file="../include/conn.asp"-->
<!--#include file="../include/session.asp"-->
<!--#include file="checkuser.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../include/style.css">
<title>邮件列表</title>
<style type="text/css">
<!--
.style2 {color: #FFFFFF}
-->
</style>
</head>
<body>
<table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="30" height="30"><div align="center"><img src="images/pic0.gif" width="14" height="11"></div></td>
          <td class="1">邮件列表</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="13"><img src="images/pic1_0.gif" width="13" height="23"></td>
          <td bgcolor="#ADBEE7">&nbsp;</td>
          <td width="13"><img src="images/pic1_1.gif" width="13" height="23"></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#ADBEE7"><table width="98%"  border="0" align="center" cellpadding="1" cellspacing="2">
      <tr>
        <td><%
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.MailFormat=0
		objCDOMail.BodyFormat=1
		objCDOMail.Send
		Set objCDOMail = Nothing
	else
		Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
		objCDOMail.From = frommail
		set rs=server.createobject("adodb.recordset")
        sql="select email from db_User order by dateandtime Desc"
		'Response.write(sql)
		'Response.end
		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=""sendmail.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">
                <tr bgcolor="#F7F3F7">
                  <td height="25" colspan="2" align="center">发送邮件列表</td>
                </tr>
                <tr bgcolor="#FFFFFF">
                  <td height="25" width="20%" align="right"><div align="left">发信人地址:</div></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"><div align="left">收信人地址:</div></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"><div align="left">信件标题:</div></td>
                  <td height="25" width="80%">
                    <input type="text" name="mailsubject" size="50" value="论坛通知">
                  </td>
                </tr>
                <tr bgcolor="#FFFFFF">
                  <td height="25" width="20%" align="right"><div align="left">信件内容:</div></td>
                  <td height="25" width="80%">
                    <textarea name="mailbody" cols="80" rows="10"><%=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>
      <tr>
        <td> </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="10" valign="top"><img src="images/pic1_2.gif" width="10" height="18"></td>
          <td bgcolor="#ADBEE7">&nbsp;</td>
          <td width="10" valign="top"><img src="images/pic1_3.gif" width="10" height="18"></td>
        </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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