<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostEmail.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
server.ScriptTimeout =3600
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canmailuser")="" Then
	ef=True
	ec="您没有此操作的权限。"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")

if Request.QueryString ("type")="host" then totable="FreeHost.FreeHost_Product_Host"
if Request.QueryString ("type")="server" then totable="FreeHost.FreeHost_Product_Host"
if Request.QueryString ("type")="email" then totable="FreeHost.FreeHost_Product_Email"
if Request.QueryString ("type")="domain" then totable="FreeHost.FreeHost_Product_Domain"
if Request.QueryString ("type")="Sql" then totable="FreeHost.FreeHost_Product_Sql"
if Request.QueryString ("type")="Other" then totable="FreeHost.FreeHost_Product_Other"

if Request.QueryString ("da") ="30" then Sql="Select * from "&totable&" where endtime<'"&dateadd("d",30,now)&"' and emailstatus is null"
if Request.QueryString ("da") ="7" then Sql="Select * from "&totable&" where endtime<'"&dateadd("d",7,now)&"' and emailstatus='a'"
	dsph.Open Sql,conn,1,3
if dsph.Eof then
	ef=True
	ec="此类内容不存在！"
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD align="left"><table height="59"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="7" background="img/midtop.gif">&nbsp;</td>
          <td width="90" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="gmail.asp"><font color="#FFFFFF"><strong>群发邮箱</strong></font></a></td>
          <td width="5" background="img/midtop2.gif">&nbsp;</td>
        </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD align="left">&nbsp;</TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="300" align="center" vAlign=top bgcolor="#FFFFFF">
	<div id="truecon">  

<table width="65%"  border="0" cellspacing="1" cellpadding="2">
  <tr>
    <td>
	
	
	<br><DIV class="tableborder">
<table width="100%"  border="0" align="center" cellpadding="2" cellspacing="1">
  <tr align="center" bordercolor="#000000" bgcolor="#999999">
    <td height="24" colspan="4" background="img/tablebg.gif"><font color="#990000"><font color="#FFFFFF">返回信息</font></font></td>
  </tr>
  <tr bordercolor="#000000" bgcolor="#E4EAF2">
    <td width="14%"><font color="#000000">&nbsp; </font></td>
    <td width="86%" colspan="3" align="left">
	
	
<br>
<br><br>成功发送<br><br>
<%
while not dsph.eof
if dsph("emailstatus")="b" then dsph("emailstatus")="c"
if dsph("emailstatus")="a" then dsph("emailstatus")="b"
if isnull(dsph("emailstatus")) then dsph("emailstatus")="a"
Set ds = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_USER where username='"&dsph("username")&"'"
ds.Open Sql,conn,1,1
if not ds.eof then%>
用户名：<%=ds("username")%>　邮箱：<%=ds("email")%>　到期时间：<%=dsph("endtime")%><br>
<%Subject=Request.Form ("suject")&"　到期时间："&dsph("endtime")
body =Request.Form ("body")

ret=Send2Mail(conn,dsph("username"),Subject,body)

end if
ds.close

dsph.update
dsph.movenext
wend
dsph.close
set dsph=nothing
%>    </td>
  </tr>


  <tr bordercolor="#000000" bgcolor="#E4EAF2">
    <td height="37" colspan="4" align="right" bgcolor="#E4EAF2"><font color="#000000"> 　　　</font><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a>	</td>
    </tr>


</table>
	</div>

	
	
	</td>
  </tr>
</table>

</div>

      </TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>
<%=htmlwrite("html10")%>
<%end if
if ef then%>
<%=ec%>
<%end if%>
<script>
var partable=parent.document.getElementById("table0");
if (partable!=null)
partable.style.display='';

partable=parent.document.getElementById("outconM");
if (partable!=null)
{partable.innerHTML = truecon.innerHTML;
document.body.innerHTML=partable.innerHTML;}
</script>
