下面代码为获取邮箱地址及干系信息
response.Redirect(34;send.asp?mail="&request("mail")&"&name="&request("name")&"&pass="&request("pass")&"&jh="&yan&"")
一下为设置邮箱和发送邮件
<%dim emailemail=request("email")username=request("username")jhm=request("jhm")password=request("password")On error resume nextDim JMail, contentIdSet JMail = Server.CreateObject("JMail.Message")JMail.Charset = "gb2312" ' 邮件字符集,默认为"US-ASCII"' JMail.ISOEncodeHeaders = False ' 是否进行ISO编码,默认为True
' 发送者信息(可用变量办法赋值)JMail.From = "####@163.com" ' 发送者地址JMail.FromName = "邮箱显示的标题" ' 发送者姓名JMail.Subject = "欢迎注册######' 邮件主题
'身份验证JMail.MailServerUserName = "登录名" ' 身份验证的用户名JMail.MailServerPassword = "邮箱密码" ' 身份验证的密码
'设置优先级,范围从1到5,越大的优先级越高,3为普通JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
' 加入一个收件人【变量email:收件人地址】可以同一语句重复加入多个JMail.AddRecipient(email)
' 加入附件【变量filename:附件文件的绝对地址,确保用户IUSR_机器名有访问的权限】' 【参数设置是(True)否(False)为Inline办法】'contentId = JMail.AddAttachment (Server.MapPath("jmail.asp"), True)
' 邮件主体(HTML(把稳信件内链接附件的办法))JMail.HTMLBody = "尊敬的用户:<br><br> 欢迎注册会员!
以下是您的注册信息:<br> 用户名:"&username&"<br> 密 码:"&password&"<br> http://www.#####.cn/jhzhanghao.asp?mail="&username&"&jhm="&jhm&""' 邮件主体(文本部分)JMail.Body = "我们的邮件采取了HTML格式,但是您的邮件查看软件可能不支持。。。邮件正文,邮件正文,邮件正文"
' 发送【调用格式:objJMail.Send([username:password@]SMTPServerAddress[:Port])】JMail.Send("smtp.163.com")
' 关闭并打消工具JMail.Close()Set JMail = Nothing
if err.number<>0 thenresponse.write "发送发送失落败!
"elseresponse.write "<script language='javascript'>"response.write "alert('请去邮箱激活账号!
');"response.write "location.href='index.asp';"response.write "</script>"response.endend if%>
jhzhanghao.asp
<% set rs=server.createobject("adodb.recordset") sql="select from ### where ###='"&request("mail")&"' and ##='"&request("jhm")&"'" rs.open sql,conn,1,3 if rs("ping")=1 or rs.bof and rs.eof then response.write "<script>alert('无效的激活!
');location.href='index.asp';</Script>" else rs("字段")=1 rs.update Response.Cookies("###")=1 Response.Cookies("###").Expires=date()+3
rs.close set rs=nothing
%><%response.write "<script>alert('您的账户已激活!
');location.href=‘跳转页面.asp';</Script>"end if
%>