<!--#include file="../include/nowshop.asp"-->
<!--#include file="checkadmin.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
<%call checkmanage("05")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<BODY bgcolor="#D9EAFC">
		  <table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
  <TBODY>
    <TR> 
      <TD width="90%" bgColor=#f4f5fd><font color="#000000">　<B><font color="#FF0000">向会员发送邮件</font></B></font></TD>
      <TD bgColor=#f4f5fd height=30><font color="#000000">&nbsp;<a href="http://www.nowshop.com.cn/help/index.asp?boardid=2&page=1" target="_blank">设置帮助</a></font></TD>
    </TR>
  </TBODY>
</TABLE>		  <table height="5"><tr><td></td></tr></table>

<%
action=request("action")
if action="send" then
call sendmail()
else
usermail=request.ServerVariables("query_string")
%>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee" width="95%">
  <form action="sendmail.asp" method=post name=usermail>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=center>收件人</td>
      <td><TEXTAREA NAME="usermail" rows=4 style="width=80% ; overflow:auto;"><%=usermail%></TEXTAREA>
        &nbsp; <img align=top src=../images/admin/memo.gif alt="填写收件人邮箱地址<br>多个邮箱以半角逗号或分号隔开<br><font color=red>千万不要发垃圾邮件哦~后果很严重</font>"> 
      </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=center>邮件主题</td>
      <td><input type=text name=mail_subject style="width=80%;" maxlength=50>
        &nbsp; <img src=../images/admin/memo.gif alt="填写邮件主题<br><font color=red>技巧：好的主题吸引人点击阅读<br>差的主题可能会被直接删除</font>"> 
      </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=center>邮件内容<br>
        <br>
        <font color=red>（1000字符以内）</font></td>
      <td><TEXTAREA NAME="mail_body" ROWS="15" style="width=80% ; overflow:auto;"></TEXTAREA>
        &nbsp; <img align=top src=../images/admin/memo.gif alt="支持html<br>但若收件人的邮箱不支持html<br>则看到的是一堆代码而矣"> 
      </td>
    </TR>
    <tr bgcolor="#FFFFFF">
      <td colspan=2> <input type=hidden name=action value="send"> <input type=submit value="立即发送"> 
        &nbsp; &nbsp; &nbsp; <input type="reset" value="重新填写"> 
  </form>
</table>
<%
end if
sub sendmail()
mail_subject=trim(request("mail_subject"))
mail_body=trim(request("mail_body"))
usermail=trim(request("usermail"))
usermail=replace(usermail," ","")
usermail=replace(usermail,"；",";")
usermail=replace(usermail,"，",";")
usermail=replace(usermail,",",";")
if usermail="" or mail_subject="" or mail_body="" then
response.write "<script language='javascript'>"
response.write "alert('出错了，收件人、邮件主题、邮件内容必须完整填写。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
if UBound(split(usermail,";"))>20 then
response.write "<script language='javascript'>"
response.write "alert('出错了，您填写的收件人太多了~~');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
Set rs = conn.Execute("select * from shopsetup") 
jmail=rs("jmail")
adm_mail=rs("adm_mail")			
qf_mailyesorno=rs("qf_mailyesorno")
mailserver=rs("mailserver")		
mailname=rs("mailname")			
mailpassword=rs("mailpassword")		
set rs=nothing
if qf_mailyesorno=1 then
dim msg
if jmail=0 then
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.To = UserMail
objMail.From =mailname
objMail.Subject = mail_subject
objMail.Body = mail_body
objMail.Send
Set objMail = Nothing
else
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.MailServerUserName = mailname
msg.MailServerPassword = mailpassword
msg.From = mailname
msg.FromName = sitename
user_mail=split(usermail,";")
for N=0 to UBound(user_mail)
msg.AddRecipient user_mail(n)
next
msg.Subject = mail_subject
msg.Body = mail_body
msg.Send (mailserver)
msg.close
set msg = nothing
end if
response.write "<script language='javascript'>"
response.write "alert('恭喜，邮件已经发出。');"
response.write "location.href='user3.asp';"
response.write "</script>"
response.end
else
response.write "<script language='javascript'>"
response.write "alert('抱歉，邮件功能没有打开。');"
response.write "location.href='user3.asp';"
response.write "</script>"
response.end
end if
end sub
%>
<table width="95%" border="0">
  <tr> 
    <td height="60"><font color="#FF0000">我们将为购买正版NowShop商城系统者免费设计全套广告图片；提供免费安装调试；免费送1%网银接口、支付宝接口；免费提供技术支持；免费提供系统升级；免费提供系统模板更换；免费代办网站ICP备案；使您的网店更具吸引力！</font></td>
  </tr>
  <tr> 
    <td><p>购买咨询或技术支持，请在周一至周五8：00-18：00间联系<br>
        Email / MSN：shop@nowshop.com.cn<br>
        电话：0551-5123308&nbsp;&nbsp;13965090551<br>
        QQ：2055008<br>
        网站：<a href="http://www.nowshop.com.cn" target="_blank">http://www.nowshop.com.cn</a><br>
        演示：<a href="http://ys.nowshop.com.cn" target="_blank">http://ys.nowshop.com.cn</a><br>
      </p>
      <p>Powerd By：NowShop商城系统 V3.5</p></td>
  </tr>
</table>
