%@ Language=VBScript%>
<%
Response.Buffer=true
Response.Expires=0
%>
<%
menu = "contact"
menuName = "联系我们"
code = Request.QueryString("code")
flag = Request.QueryString("flag")
set cn = Server.CreateObject("adodb.Connection")
set rs = Server.CreateObject("adodb.Recordset")
cn.Open mycnstr
if Request.ServerVariables("REQUEST_METHOD")="POST" then
if code = "" or not isnumeric(code) then
Response.Redirect "contact.asp?flag=0"
end if
title = fixedReplaceStr(Request.Form("title"), 60)
email = fixedReplaceStr(Request.Form("email"), 50)
myname = fixedReplaceStr(Request.Form("myname"), 10)
corpname = fixedReplaceStr(Request.Form("corpname"), 60)
address = fixedReplaceStr(Request.Form("address"), 60)
phone = fixedReplaceStr(Request.Form("phone"), 20)
fax = fixedReplaceStr(Request.Form("fax"), 20)
content = fixedReplaceStr(Request.Form("content"), "")
'检查是否选择了部门,并查找部门的邮箱地址
sql="select email from sys_dept where code='"+code+"'"
rs.Open sql,cn,0,1,1
if not rs.EOF then
sys_email=trim(rs("email"))
end if
rs.Close
'如果部门有邮箱地址,发送电子邮件
if sys_email <> "" then
txt="这个一封来自"+Request.ServerVariables("Http_HOST")+"的在线提交邮件!当您收到这封邮件后请不要直接回复,因为您只能直接回复到网站"
mailstr=txt+ chr(13) + chr(10)
mailstr=mailstr + "姓名:" + myname + chr(13) + chr(10)
mailstr=mailstr + "单位:" + corpname + chr(13) + chr(10)
mailstr=mailstr + "电话:" + phone + chr(13) + chr(10)
mailstr=mailstr + "地址:" + address + chr(13) + chr(10)
mailstr=mailstr + "传真:" + fax + chr(13) + chr(10)
mailstr=mailstr + "Email:" + email + chr(13) + chr(10)
mailstr=mailstr + "IP地址:" + Request.ServerVariables("Remote_HOST") + chr(13) + chr(10)
mailstr=mailstr + "内容:" + content + chr(13) + chr(10)
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.MailServerUserName = "public@ibw.com.cn" '输入smtp服务器验证登陆名
msg.MailServerPassword = "wangxin108" '输入smtp服务器验证密码 (用户Email帐号对应的密码)
if email="" then
msg.From ="public@ibw.com.cn"
else
msg.From = email
end if
msg.FromName = myname '发件人姓名
msg.AddRecipient sys_email '收件人Email
'msg.AddRecipientBCC "napoleon@ibw.com.cn" '密件传送'
msg.Subject = Request.ServerVariables("Http_HOST")+"网站留言"&now() '信件主题
msg.Body = "主题:"+title+chr(10)+chr(13)+mailstr '正文
msg.Send ("smtp.sina.net") 'smtp服务器地址(企业邮局地址)
set msg = nothing
end if
sql = "insert into contact (title,email,myname,corpname,address,phone,fax,content,flag,code,creadate, sysemail) values"_
& "('"&title&"','"&email&"','"&myname&"','"&corpname&"','"&address&"','"&phone&"','"&fax&"','"&content&"','0','"&code&"','"& now() &"', '"&sys_email&"')"
cn.Execute sql
set rs = nothing
cn.Close
set cn = nothing
Response.Redirect "contact.asp?code="&code&"&flag=1"
end if
if code = 0 then
sql="select top 1 code,deptname,address,phone,fax,email,website,zip from sys_dept order by sortnum"
else
sql="select code,deptname,address,phone,fax,email,website,zip from sys_dept where code='" & code & "'"
end if
rs.Open sql,cn,0,1,1
if not rs.EOF then
code=rs("code")
deptname=trim(rs("deptname"))
address=trim(rs("address"))
phone=trim(rs("phone"))
fax=trim(rs("fax"))
email=trim(rs("email"))
website=trim(rs("website"))
zip=trim(rs("zip"))
else
response.end
end if
rs.Close
%>
桐庐兴容制笔厂--来自中国制笔之乡的制笔专家
| |
|
|
|
<%
if flag = "0" then
Response.Write " 留言失败!
"
elseif flag = "1" then
Response.Write " 留言成功!
"
end if
%>
|
| |
 |
 |
公司地址:浙江省桐庐县分水镇邱家山116号
| 电话:0571-64308969 | 传真:0571-64313523
版权所有 桐庐兴容制笔厂 | www.xrpen.com All Rights Reserved 中国笔网设计制作 |
|
 |
|
|
|