<%
dim xingming,sex,san,renshu,mudidi,tianshu,feiyong,tel,email
xingming=request("name")
sex=request("sex")
san=request("san")
rensh=request("rensh")
shouru=request("shouru")
mudidi=request("mudidi")
tianshu=request("tianshu")
feiyong=request("feiyong")
tel=request("tel")
email=request("email")
%>
<%
On error resume next
Dim JMail, contentId
Set JMail = Server.CreateObject("JMail.Message")
JMail.Charset = "gb2312" ' 邮件字符集,默认为"US-ASCII"
' JMail.ISOEncodeHeaders = False ' 是否进行ISO编码,默认为True
' 发送者信息(可用变量方式赋值)
JMail.From = "njbxhome@163.com" ' 发送者地址
JMail.FromName = "第三方旅游" ' 发送者姓名
JMail.Subject = "订单来啦!" ' 邮件主题
' 身份验证
JMail.MailServerUserName = "njbxhome" ' 身份验证的用户名
JMail.MailServerPassword = "huajian" ' 身份验证的密码
' 设置优先级,范围从1到5,越大的优先级越高,3为普通
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
' 加入一个收件人【变量email:收件人地址】可以同一语句重复加入多个
JMail.AddRecipient(""&request("youjian")&"")
' 加入附件【变量filename:附件文件的地址,确保用户IUSR_机器名有访问的权限】
' 【参数设置是(True)否(False)为Inline方式】
'contentId = JMail.AddAttachment (Server.MapPath("jmail.asp"), True)
' 邮件主体(HTML(注意信件内链接附件的方式))
JMail.HTMLBody = "需求人姓名:"&xingming&"<br>性别:"&sex&"<br>团体/散客:"&san&"<br>人数:"&renshu&"<br>目的地:"&mudidi&"<br>天数:"&tianshu&"<br>费用:"&feiyong&"<br>联系电话:"&tel&"<br>电子邮箱:"&email&"<BR>"
' 邮件主体(文本部分)
JMail.Body = "见HTML"
' 发送【调用格式:objJMail.Send([username:password@]SMTPServerAddress[:Port])】
JMail.Send("smtp.163.com")
' 关闭并清除对象
JMail.Close()
Set JMail = Nothing
if err.number<>0 then
Response.write "<script>alert('邮件发送失败!');</script>"
Response.write "<script>history.go(-1);</script>"
else
Response.write "<script>alert('恭喜!邮件发送成功!');</script>"
Response.write "<script>history.go(-1);</script>"
end if
%>
<%else
Response.write "<script>alert('资料填写不全!');</script>"
Response.write "<script>history.go(-1);</script>"
%>
<%end if%>