<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/md5.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%if Not ChkPosturl then response.redirect ("/login.asp")
if session("id")="" then
response.write "<script language='javascript'>"
response.write "alert('非法操作，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
title=nosql(request.form("messageTitle"))
title=replace(title,"&lt;b&gt;","<b>")
title=replace(title,"&lt;/b&gt;","</b>")
content=nosql(request.form("messageContent"))&nosql(request("show"))
bg=nosql(request("bg"))
sendemail=nosql(request.form("sendemail"))
saveSendMessage=nosql(request.form("saveSendMessage"))
sendContact=nosql(request.form("sendContact"))
mycid=nosql(request.form("mycid"))
username=nosql(request.form("username"))
checkdate=nosql(request.form("checkdate"))

if saveSendMessage<>"" then
set rs1=server.createobject("adodb.recordset")
sql1="select * from snsn_getprice1 where (id is null)" 
rs1.open sql1,conn,1,3
rs1.addnew
rs1("title")=title
rs1("content")=content
rs1("bg")=bg
if sendemail<>"" then
rs1("sendemail")=sendemail
else
rs1("sendemail")=0
end if
if sendcontact<>"" then
rs1("sendcontact")=sendcontact
else
rs1("sendcontact")=0
end if
if checkdate<>"" then
rs1("checkdate")=checkdate
else
rs1("checkdate")=0
end if
rs1("limitedtime")=start_year&"年"&start_month&"月"&start_day
rs1("requestinfo")=requestinfo
rs1("mycid")=mycid
rs1("sendcid")=session("id")
rs1("datetime")=now()
sid=rs1("id")
rs1.update
end if

set rs=server.createobject("adodb.recordset")
sql="select * from snsn_getprice where (id is null)" 
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("content")=content
rs("bg")=bg
if sendemail<>"" then
rs("sendemail")=sendemail
else
rs("sendemail")=0
end if
if sendcontact<>"" then
rs("sendcontact")=sendcontact
else
rs("sendcontact")=0
end if
if checkdate<>"" then
rs("checkdate")=checkdate
else
rs("checkdate")=0
end if
rs("limitedtime")=start_year&"年"&start_month&"月"&start_day
rs("requestinfo")=requestinfo
rs("mycid")=mycid
rs("sendcid")=session("id")
rs("datetime")=now()
rs("getprice1id")=sid
rs.update

rs.close
'set rs=noting

conn.close
set conn=nothing
%>
<%
if sendemail<>"" then
Dim mailbody
' 声明变量

	mailbody="<html>"
	mailbody=mailbody & "<head>"
	mailbody=mailbody & "<TABLE border=0 width='95%' align=center><TBODY><TR>"
	mailbody=mailbody & "<TD valign=middle align=top>"
	mailbody=mailbody & username&"，您好：<br><br>"
	mailbody=mailbody & "你在" & webname & "上的好友给你留言了，请尽快查看！<br>"
	mailbody=mailbody & "地址是：" & weburl & "my/getprice/receivemessagelist.asp"
	mailbody=mailbody & "<br><br>"
	mailbody=mailbody&""&webname&" ◎ 客户服务中心<br>" 
    mailbody=mailbody&"================================================== <br>电话："&dh&"<br>"
    mailbody=mailbody&"Email："&webemail&"<a href="&weburl&" target=_blank>"&weburl&"</a> </body></html>" 

      topic="你好，你在"&webname&"网站上有人回复！" ' 信件主题
      mailbody=mailbody ' 信件内容
    Dim JMail
	on error resume next
	 Set jmail = Server.CreateObject("JMAIL.Message")   '建立发送邮件的对象
     jmail.silent = true    '屏蔽例外错误，返回FALSE跟TRUE两值j
     mail.logging = true   '启用邮件日志
     jmail.Charset = "GB2312"     '邮件的文字编码为国标
     jmail.ContentType = "text/html"    '邮件的格式为HTML格式
     jmail.AddRecipient Email     '邮件收件人的地址
     jmail.From = fmail   '发件人的E-MAIL地址
     jmail.MailServerUserName = umail     '登录邮件服务器所需的用户名
     jmail.MailServerPassword = pmail     '登录邮件服务器所需的密码
     jmail.Subject = Topic    '邮件的标题 
     jmail.Body = MailBody      '邮件的内容
     jmail.Prority = 1      '邮件的紧急程序，1 为最快，5 为最慢， 3 为默认值
     jmail.Send(smail)     '执行邮件发送（通过邮件服务器地址）
     jmail.Close()   '关闭对象
	Set JMail = Nothing
	end if
response.write"<SCRIPT language=JavaScript>alert('发送成功，请返回！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end

%>