<%
response.buffer=false
%>
<!--#include virtual="/incs/config.asp"-->
<%
 Server.ScriptTimeOut=500 
   on error resume next
   conn.open constr
chk_newpwr 4,19,4
 ms_rec=SafeRequest("ms_rec")
 ms_rec_cls=SafeRequest("ms_rec_cls")
 ms_ttl=Request("ms_ttl")
 ms_bdy=Request("ms_bdy")
 ms_ifhtm=SafeRequest("ms_ifhtm")
 gid=SafeRequest("gid")
 grd=SafeRequest("grd")
 ms_mod=SafeRequest("ms_mod")
 gnme=SafeRequest("gnme")
 if ms_ttl="" then
      call errorpage(-2,"对不起，邮件标题不能为空！")
end if	  
 if ms_bdy="" then
      call errorpage(-2,"对不起，邮件内容不能为空！")
end if	  
if ms_ifhtm<>"1" then
ms_ifhtm="0"
end if
errorcount=0
successcount=0
''####################收件人不为空时
''####################收件人不为空时
''####################等级不为空时
''####################等级不为空时
%>
<!--#include virtual="/incs/top.asp"-->
<table cellspacing=2 cellpadding=0 width="100%" border=0>
  <tbody> 
  <tr> 
    <td  colspan=2 valign="middle"> 
      <table class=line cellspacing=0 cellpadding=0 width="100%" 
                  border=0 align="center">
        <tbody> 
        <tr> 
          <td valign=bottom width="25%" height=20><b>邮件群发</b></td>
          <td valign=bottom noWrap align=right 
                        width="75%">&nbsp;</td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=5></td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=2  class=menuline></td>
        </tr>
        </tbody> 
      </table>
      <br>
    </td>
  </tr>
  <tr> 
    <td  colspan=2 valign="middle" height="8" align="center"> 
    </td>
  </tr>
  </tbody> 
</table>
<table  cellspacing='0' cellpadding='0' align="center" id=rollbar>
  <tr> 
    <td align='center' valign='middle'> 
      <table cellspacing='0' cellpadding='2' style='font-size:9pt;'>
        <tr> 
          <td style='border-width:1px; border-style: groove;'><img id='subokk' src="/imgs/submitimg.gif" border='0' width='398' height='4'></td>
        </tr>
        <tr> 
          <td style='border-width:0px;' align='center' height='10'></td>
        </tr>
        <tr> 
          <td style='border-width:0px; font-family:宋体; font-size: 9pt;' align='center' height="10"> 
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="60%"  class=datalist>
  <tr> 
    <th  class=datalistheader   align='center' valign='middle' width="10%">序号</th>
    <th  class=datalistheader   align='center' valign='middle' width="30%">会员</th>
    <th  class=datalistheader   align='center' valign='middle' width="40%">邮箱</th>
    <th  class=datalistheader   align='center' valign='middle'>结果</th>
  </tr>
</table>
<%
if  len(trim(ms_rec))>0 then
ms_recs=split(ms_rec,",")
countnum=0
for tempcnt=0 to ubound(ms_recs)
countnum=countnum+1
recs=jmailsend(ms_recs(tempcnt),ms_ttl,ms_bdy,ms_ifhtm) 
if recs then
successcount=successcount+1
else
errorcount=errorcount+1
end if
if recs then
ifsendwrd="成功"
else
ifsendwrd="<font color=#ff0000>失败</font>"
end if
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''发信完毕 
%>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="60%"  class=datalist>
  <tr> 
  <tr> 
    <td  class=datalistgrida   align='center' valign='middle' width="10%"><%=countnum%></td>
    <td  class=datalistgrida   align='center' valign='middle' width="30%">&nbsp;</td>
    <td  class=datalistgrida   align='center' valign='middle' width="40%"><a  class=commonface href="mailto:<%=ms_recs(tempcnt)%>" %><%=ms_recs(tempcnt)%></a></td>
    <td  class=datalistgrida   align='center' valign='middle'><%=ifsendwrd%></td>
  </tr>
</table>

<%
next
end if
	
%>

<%
if chk_int(ms_rec_cls) then
select case ms_rec_cls
case "-1"
query="select u_eml,u_nme from v_memlst order by u_nme"
case "-2"
query="select u_eml,u_nme from v_memlst where  (c_pwr=1 or c_pwr=2) order by u_nme"
case "-3"
query="select u_eml,u_nme from v_memlst where  (c_pwr=1) order by u_nme"
case "-4"
query="select u_eml,u_nme from v_memlst where  (c_pwr=2) order by u_nme"
case "-5"
query="select u_eml,u_nme from v_memlst where  (u_sys=3) order by u_nme"
case else
query="select u_eml,u_nme from v_memlst where  (u_prc="&ms_rec_cls&") order by u_nme"
end select
rs.open query,conn,1,1

while not rs.eof
recs=jmailsend(trim(rs("u_eml")),ms_ttl,ms_bdy,ms_ifhtm) 
if recs then
successcount=successcount+1
else
errorcount=errorcount+1
end if
if recs then
ifsendwrd="成功"
else
ifsendwrd="<font color=#ff0000>失败</font>"
end if
countnum=countnum+1
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''发信完毕 
%>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="60%"  class=datalist>
  <tr> 
  <tr> 
    <td  class=datalistgrida   align='center' valign='middle' width="10%"><%=countnum%></td>
    <td  class=datalistgrida   align='center' valign='middle' width="30%"><a href="javascript:showurl('/master/memmng/mem_dtl.asp?unme=<%=rs("u_nme")%>');" class=commonface><%=rs("u_nme")%></a></td>
    <td  class=datalistgrida   align='center' valign='middle' width="40%"><a  class=commonface href="mailto:<%=rs("u_eml")%>" %><%=rs("u_eml")%></a></td>
    <td  class=datalistgrida   align='center' valign='middle'><%=ifsendwrd%></td>
  </tr>
</table>

<%
rs.movenext
wend
rs.close

end if
	

response.write "<script>"&vbcrlf
response.write "rollbar.style.display='none';"&vbcrlf
response.write "</script>"
			%>
<% Server.ScriptTimeOut=90 %>
<br>
<br>
<br>
<!--#include virtual="/incs/bottom.asp"-->


