<%@ LANGUAGE = VBScript.Encode %>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
<TITLE>邮件订阅信息编辑</TITLE>
<link rel="stylesheet" href="Images/Admin.css">
<script language="javascript" src="../Scripts/Admin.js"></script>
</HEAD>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="Admin_htmlconfig.asp"-->
<br />
<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
  <form name="SendMail" method="post" action="Admin_EMailPub.asp?Action=Send">
    <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【企业注册用户、邮件订阅邮件群发】</th>
    </tr>
    <tr>
      <td width="200" align="right" class="forumRow">发信人：</td>
      <td class="forumRowHighlight"><input name="ToEMail" type="text" id="ToEMail" style="width: 350" value="<%= Request("selectemail") %>">
        <input type="checkbox" name="UserEMail" value="on">
        发送给所有注册会员（默认发送所有邮件订阅用户）<br />
        <font color="#CC0000">手动录入，请以“,”分隔邮箱地址。</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">邮件标题：</td>
      <td class="forumRowHighlight"><input name="EMailTitle" type="text" id="EMailTitle" style="width: 500" value=""></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">邮件内容：</td>
      <td class="forumRowHighlight"><textarea name="EMailBody" id="EMailBody" style="display: none"></textarea>
        <iframe ID="eWebEditor1" src="eWebEditor/ewebeditor.htm?id=EMailBody&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></iframe></td>
    </tr>
    <tr>
      <td class="forumRow"></td>
      <td class="forumRowHighlight"><input name="SendMailPub" type="button" id="SendMailPub" value="批量发送邮件" onclick="doSubmit()">
        <input type="button" value="返回上一页" onclick="history.back(-1)"></td>
    </tr>
  </form>
</table>
<br />
<script language="JavaScript">
function doSubmit(){
    if (document.SendMail.EMailTitle.value==""){
        alert("请填写邮件标题！");
        document.SendMail.EMailTitle.focus();
        return false;
    }
    if (eWebEditor1.getHTML()==""){
        alert("请填写邮件内容！");
        return false;
    }
    document.SendMail.submit();
}
</script>
<%
if Trim(Request.QueryString("Action"))="Send" then
strTitle=Trim(Request.QueryString("EMailTitle"))
strSubject=Trim(Request.QueryString("EMailBody"))
strToEmail=Trim(Request.QueryString("ToEMail"))
if Trim(Request.QueryString("UserEMail"))="on" then
    sql="select id,Email from liangjing_Members"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,1
	if not rs.eof then
	do while not rs.eof
	strToEmail="'" & strToEmail
	strToEmail=strToEmail & rs("Email")
	rs.movenext
	loop	
	end if
	rs.close
	set rs=nothing
end if
Call ShopSendEmail(strToEmail,JMailTitle&strTitle,strSubject)
end if%>