<%
action=request("action")
if action="ok" then
'==================================================
' 参 数 设 置
'==================================================

'所使用的SMTP服务器，例如smtp.sea521.com
smtpserver = "smtp.sea521.com"

'如果SMTP服务器需要发信认证，则设置登录SMTP服务器的用户名和密码
smtpuser = "XXX@XXX.com"
smtppwd = "XXXX"

'与相应SMTP服务器对应的邮件地址
'注意：很多SMTP服务器除了要验证用户名和密码外，还要验证发件人地
'址，比如163.com的SMTP服务器在检查发信人邮件地址是不是以163.com
'结尾，否则不予发送，因此，使用相应的信箱做为发信人信箱是必要的
smtpemail = "XXX@XXXX.com"

'==================================================
' 程 序 开 始
'==================================================
tname = trim(Request("name"))
login = trim(Request("login"))
order=trim(Request("order"))
tel=trim(Request("tel"))
temail = trim(Request("email"))
hkje=trim(Request("hkje"))
hkrq=trim(Request("hkrq"))
hkfs=trim(Request("hkfs"))
fhfs=trim(Request("fhfs"))
tsubject = ""&tname&"汇款确认"
tbody = trim(Request("body"))
myemail="jzhaifeng@163.com"    '设为管理圆邮箱

if tname="" or login="" or order="" or tel="" or temail="" or hkje="" or hkrq="" or hkfs="" or tbody="" then
response.write("<script language=javascript>" & _
     vbcrlf & "alert(""您提交的信息不全，请重新填写！"");" & _
     vbcrlf & "location='javascript:history.back()'" & _    
           vbcrlf & "</script>")
response.end
end if

mailbody=mailbody &"<style>A:visited { TEXT-DECORATION: none }"
 mailbody=mailbody &"A:active  { TEXT-DECORATION: none }"
 mailbody=mailbody &"A:hover   { TEXT-DECORATION: underline }"
 mailbody=mailbody &"A:link    { text-decoration: none;}"
 mailbody=mailbody &"BODY   { FONT-FAMILY: 宋体; FONT-SIZE: 9pt;}"
 mailbody=mailbody &"TD    { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }</style>"
 mailbody=mailbody &"<TABLE border=0 width='95%' align=center><TBODY><TR><TD>"
 mailbody=mailbody &"管理员：以下是我的订购信息"
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"========================================================="
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"姓名："&tname&"" 
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"注册用户："&login&""
    mailbody=mailbody &"<br><br>"
   mailbody=mailbody &"订单号码："&order&""
   mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"联系电话："&tel&""
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"汇款金额："&hkje&""
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"汇款日期："&hkrq&"" 
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"汇款方式："&hkfs&"" 
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"发货方式："&fhfs&"" 
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"简短附言："&tbody&""
 mailbody=mailbody &"<br><br>"
 mailbody=mailbody &"=========================================================" 
 mailbody=mailbody &"</TD></TR></TBODY></TABLE>"
if tname <> "" and temail <> "" then
set jmail= server.CreateObject ("jmail.message")
jmail.Silent = true
jmail.Charset = "gb2312"
JMail.ContentType = "text/html"

if smtpemail <> "" then
jmail.From = "jzhaifeng@163.com"
else
jmail.From = temail
end if

jmail.FromName = tname
jmail.ReplyTo = temail
jmail.Subject = tsubject
jmail.AddRecipient myemail,myname
jmail.Body = mailbody 
jmail.MailServerUserName = smtpuser
jmail.MailServerPassWord = smtppwd
isgo = jmail.Send(smtpserver)
if isgo then
response.write("<script language=javascript>" & _
     vbcrlf & "alert(""提交成功！我们将根据您提交的信息及时备货，款到一个工作日内寄出产品，谢谢您的支持！"");" & _
     vbcrlf & "location='javascript:history.back()'" & _    
           vbcrlf & "</script>")

else
response.write("<script language=javascript>" & _
     vbcrlf & "alert(""发送失败！请检查您的邮件地址是否填写正确。"");" & _
     vbcrlf & "location='javascript:history.back()'" & _    
           vbcrlf & "</script>")
end if

jmail.Close
set jmail = nothing
end if
end if
%>