转自别处。很好用。。
====================================
<%
'flash里传过来的变量
Dim JMail, contentId,firstname,price,quantity,fn,ln,email,tel,country,ingame,allInfo
sn = request.form("sn")
price = request.form("price")
quantity = request.form("quantity")
fn = request.form("fn")
ln = request.form("ln")
email = request.form("email")
tel = request.form("tel")
country = request.form("country")
ingame = request.form("ingame")
GameName = request.form("GameName")
allInfo="serverName="&sn&"<br>"&"price="&price&"<br>"&"quantity="&quantity&"<br>"&"firstname="&fn&"<br>"&"lastname="&ln&"<br>"&"email="&email&"<br>"&"telphone="&tel&"<br>"&"country="&country&"<br>"&"ingame="&ingame
'response.write firstname
Set JMail = Server.CreateObject("JMail.Message")
JMail.Charset = "gb2312" ' 邮件字符集,默认为"US-ASCII"
' JMail.ISOEncodeHeaders = False ' 是否进行ISO编码,默认为True
' 服务器邮箱信息(可用变量方式赋值)
JMail.From = "用户@163.com" ' 发送者地址
JMail.FromName = fn ' 发送者姓名
JMail.Subject = "book game card" ' 邮件主题
JMail.MailServerUserName = "用户" ' 身份验证的用户名
JMail.MailServerPassword = "密码" ' 身份验证的密码
' 设置优先级,范围从1到5,越大的优先级越高,3为普通
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
' 加入一个收件人【变量email:收件人地址】可以同一语句重复加入多个
JMail.AddRecipient("")
' 加入附件【变量filename:附件文件的绝对地址,确保用户IUSR_机器名有访问的权限】
' 【参数设置是(True)否(False)为Inline方式】
'contentId = JMail.AddAttachment (Server.MapPath("jmail.asp"), True)
' 邮件主体(HTML(注意信件内链接附件的方式))
JMail.HTMLBody = "<html><head><META content=zh-cn http-equiv=Content-Language><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312""><style type=text/css>A:link { FONT-SIZE: 9pt; TEXT-DECORATION: none; color: #000000}A:visited {FONT-SIZE: 9pt; TEXT-DECORATION: none; color: #666666}A:hover {COLOR: #ff6600; FONT-SIZE: 9pt; TEXT-DECORATION: underline}BODY {FONT-SIZE: 9pt} --></style></head><body><font color=red>我很牛X,我成功咧啊。。。。。。</font><br><font color=green>邮件正文</font><br><b>邮件正文</b></body></html>"
' 邮件主体(文本部分)
JMail.Body = allInfo
' 发送【调用格式:objJMail.Send([username:password@]SMTPServerAddress[:Port])】
JMail.Send("smtp.163.com")
' 关闭并清除对象
JMail.Close()
Set JMail = Nothing
if err.number<>0 then
response.write "data=发送发送失败!"
else
response.write "data=邮件发送成功!"
end if
%>
=======================================