<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Include/connect.asp" -->
<!--#Include File="antisqlin/Neeao_SqlIn.Asp"-->
<!--#include file="Include/md5code.asp" -->
<%
function gen_key(digits)
dim rndnum,num
Randomize
Do while Len(rndnum)<digits
num = Cstr(Chr((57-48)*rnd+48))
rndnum = rndnum & num
Loop
gen_key = rndnum
End function
%>
<%
username=request.form("username")
email=request.form("email")
set rs = server.CreateObject("adodb.recordset")
sql="select * from Show5_ALLUser where Username='"&Username&"'"
rs.open sql,cn,1,3
if rs("Email") <> email then
Response.write("<script>alert('您填写的Email与此用户不符，请返回检查！');window.location.replace('getpsw.asp');</script>")
else
newpsw=gen_key(8)
rs("Password")=md5(newpsw)
rs.update
rs.close
set rs=nothing
end if

	Set JMail = Server.CreateObject("JMail.Message")
	JMail.Logging = False
	JMail.silent = True
	JMail.Charset = "gb2312"

	JMail.From = "altheran@126.com" '发送者地址
	JMail.FromName = "秀我网管理员" '发送者姓名
	JMail.Subject = "秀我网用户密码取回通知" '邮件主题
	JMail.Priority = 1
	JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")

	JMail.MailServerUserName = "altheran" '身份验证的用户名
	JMail.MailServerPassword = "zhouyu118" '身份验证的密码
	
	JMail.AddRecipient ""&email&""
     
	'邮件主体
	JMail.Body = "您的新密码是："&newpsw&""	
	SendMail = JMail.Send("smtp.126.com")
	JMail.Close
    Set JMail=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="CSS/Hompy/hompy.css" type=text/css rel=stylesheet>
<title>取回密码</title>
</head>
<body leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<table width="320" height="157" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="279" class="orange2_b" style="PADDING-LEFT: 10px; HEIGHT: 24px;BORDER-TOP: #cecfce 1px solid; BORDER-BOTTOM: #cecfce 1px dotted; BACKGROUND-COLOR: #f7f7f7"> 
      取回密码</td>
  </tr>
  <tr> 
    <td height="127" align="center">新密码已发送至您的邮箱，请查收！<a href="#" onClick="window.close();"><img src="Images/Hompy/btn_confirm.gif" width="39" height="18" border="0" align="absmiddle"></a></td>
  </tr>
  <tr> 
    <td style="HEIGHT: 4px; BORDER-TOP: #cecfce 1px dotted; BORDER-BOTTOM: #cecfce 1px solid; BACKGROUND-COLOR: #f7f7f7"><img src="" width="4" height="4" alt=""></td>
  </tr>
</table>
</body>
</html>