<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx10<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<%
Server.ScriptTimeout=999999
fwq=Request.form("fwq")
passname=request.form("passname")
password=request.form("password")
title=Request.form("title")
txt=request.form("txt")
name=request.form("name")
radiobutton=request.form("radiobutton")
fa=request.form("fa")
faemail=request.form("faemail")
hjf=request.form("hjf")
session("fwq")=fwq
session("passname")=passname
session("password")=password
session("title")=title
session("txt")=txt
session("name")=name
session("radiobutton")=radiobutton
session("fa")=fa
session("faemail")=faemail
session("hjf")=hjf
If fwq = "" then
Response.Write "没有填写邮件服务器,将无法发送"
Response.End 
End If
If title="" Then
Response.Write ("<script>alert('邮件标题没有填写，将无法发送信息');javascript:history.back(1)</script>")
response.end
end if
if txt="" then
Response.Write ("<script>alert('邮件内容没有填写，将无法发送信息');javascript:history.back(1)</script>")
response.end
end if
if name<>"" then
set jmail=server.createobject("jmail.message")
jmail.charset="gb2312"
jmail.silent=true
jmail.addrecipient name
jmail.subject=title
if radiobutton="text" then
jmail.appendtext txt
elseif radiobutton="html" then
jmail.appendtext "这是一封html格式的邮件"
jmail.appendhtml txt
end if
if fa<>"" then
jmail.fromname = fa
end if
if faemail<>"" then
jmail.from=faemail
end if
jmail.priority = hjf
if passname<>"" then
jmail.MailServerUserName =passname
end if
if password<>"" then
jmail.MailServerPassWord =password
end if
errs=jmail.send(fwq)
jmail.close
set jmail=nothing 
if errs then
Response.Write ("<script>alert('邮件内容已经发送到指定的邮箱地址了，请确定返回！');javascript:history.back(1)</script>")
else
response.write ("<script>alert('由于系统错误，邮件未能正常发送，请确定返回检查各项数据是否错误！');javascript:history.back(1)</script>")
end if
response.end
end if
'----------------------------------------------------------
if name="" then
set jmail = server.createobject("jmail.message")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "Select * from shop_user order by userid DESC",conn,1,1
do while not rs.eof
jmail.charset="gb2312"
jmail.Silent=true
jmail.addrecipient rs("useremail")
jmail.subject = title
if radiobutton="text" then
jmail.appendtext txt
elseif radiobutton="html" then
jmail.appendtext "这是一封html格式的邮件"
jmail.appendhtml txt
end if
if fa<>"" then
jmail.fromname = fa
end if
if faemail="" then
jmail.from=faemail
end if
jmail.priority = hjf
if passname<>"" then
jmail.MailServerUserName =passname
end if
if password<>"" then
jmail.MailServerPassWord =password
end if
errs=jmail.send(fwq)
jmail.clear
rs.movenext
loop 
jmail.close
set jmail=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing
if errs then
Response.Write ("<script>alert('邮件内容已经发送到指定的邮箱地址了，请确定返回！');javascript:history.back(1)</script>")
else
response.write ("<script>alert('由于系统错误，邮件未能正常发送，请确定返回检查各项数据是否错误！');javascript:history.back(1)</script>")
end if
response.end
end if
%>