丰满饥渴老太性hd_亚州影院_天堂在线视频_香蕉视频在线网站 - 一本色道久久综合一区

您現(xiàn)在的位置:首頁 >> 老y討論區(qū) >> 程序討論 >> 添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
程序討論版須知:

在使用老y文章管理系統(tǒng)中的一些問題!對非本程序方面的問題恕不解答!對Html,css等基礎(chǔ)問題恕不解答!如果沒有HTML基礎(chǔ)請先自學(xué)HTML!

需要打開你網(wǎng)站才能看出問題的請留下網(wǎng)址,并請保留本站版權(quán)及友情鏈接,否則不予回復(fù)。

 程序討論  站長交流  鏈接交換  商業(yè)用戶區(qū)
 
樓主Time:2016/5/25 0:36:21
江西藍(lán)佰實業(yè)有限公司
  • 等級:注冊會員
  • 注冊:2016-05-25
  • Y幣:15 元
添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
關(guān)鍵字:密碼 郵箱
<!--#include file="../Inc/conn.asp"-->
<!--#include file="../Inc/md5.asp"-->
<%
If useroff=0 then Call Alert("網(wǎng)站目前已經(jīng)關(guān)閉會員功能","../")
if request("action") = "zhaohui" then 
call zhaohui()
else
call list()
end if

Sub zhaohui

UserName = CheckStr(trim(request.form("UserName")))
email = CheckStr(trim(request.form("email")))

if UserName="" then
Call Alert ("請輸入用戶名","-1")
end if
if email="" then
Call Alert ("請輸入電子郵箱","-1")
End if

Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open "Select [username],[email] From ["&tbname&"_User] where Email='" &email&"' and username='" &UserName&"'" , conn, 1,3
if rst.bof then
Call Alert ("用戶名或郵箱錯誤!","-1")
End if
rst.close
set rst=nothing




'------------生成隨機密碼-------------

Randomize 
Do While Len(pass)<8 '隨機密碼位數(shù) 
num1=CStr(Chr((57-48)*rnd+48)) '0~9 
num2=CStr(Chr((90-65)*rnd+65)) 'A~Z 
num3=CStr(Chr((122-97)*rnd+97)) 'a~z 
pass=pass&num3&num1&num2 
loop 

'------------生成隨機密碼-------------

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select [password] From ["&tbname&"_User] where username='" &UserName&"'", conn, 3,3
if not rs.bof then
rs("PassWord")=md5(pass,16)
rs.update
end if
rs.close
set rs=nothing

'-------------發(fā)送電子郵件-----------------

zw="您好!<br>尊敬的用戶 :"&UserName&" <br>您的臨時新密碼為<font color='red'>"&pass&"</font>,請盡快登錄本站修改密碼。<br><br>"&sitetitle&"<br>網(wǎng)站:"&siteurl
SendEmail email,sitetitle&"-找回密碼",zw,2

'--------------發(fā)送電子郵件----------------

Call Alert ("操作成功,新密碼已經(jīng)發(fā)送到您的郵箱!",Request.ServerVariables("HTTP_REFERER"))
End Sub

Sub list
If LaoYID>0 then
Response.Redirect SitePath
End if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="<%=Sitekeywords%>" />
<link href="<%=SitePath%>images/css<%=Css%>.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="<%=SitePath%>js/main.asp"></script>
<title>找回密碼</title>
</head>
<body>
<div class="mwall">
<%=Head%>
<%=Menu%><div class="mw">
<div style='margin:100px auto;'>
  <form action="<%=SitePath%>User/Getpass.asp?action=zhaohui" method="post" name=loginForm>
<table width="390" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30" colspan="2" align="center">請?zhí)顚懩愕挠脩裘妥詴r填寫的郵箱,系統(tǒng)將把新密碼發(fā)送到您的郵箱!</td>
    </tr>
  <tr>
    <td width="150" height="30" align="right">用戶名:</td>
    <td align="left"><input name="Username" class="borderall" type="text" size="15" style="width:100px;height:15px;"></td>
  </tr>
  <tr>
    <td width="150" height="30" align="right">郵 箱:</td>
    <td align="left"><input name="email" class="borderall" type="text" size="15" style="width:100px;height:15px;"></td>
  </tr>
  <tr>
    <td height="30" colspan="2"><input type="submit" name="Submit" value="找回登錄密碼" class="borderall" style="height:19px;"/></td>
  </tr>
</table>
</form>
</div>
</div>
<%=Copy%>
</div>
</body>
</html>
<%
End Sub



'-----------------------------------------------------------發(fā)送電子郵件

Sub SendEmail(Email,mailtitle,Mailbody,zj) 
On Error Resume Next


E_Server = "smtp.qq.com 這里寫發(fā)件服務(wù)器" ''發(fā)件服務(wù)器 
E_ServerUser = "發(fā)件人郵箱登錄名" ''登錄用戶名 
E_ServerPass = "發(fā)件人郵箱登錄密碼" ''登錄密碼 
E_SendManMail = "這里寫發(fā)件人的郵箱地址" ''發(fā)件人郵件地址 
E_SendManName = "這里寫發(fā)件人的姓名" ''發(fā)件人姓名



If zj="" or zj=1 Then

'JMail方法

Set JMail = Server.CreateObject("JMail.Message") 
JMail.silent=true 
JMail.Logging = True 
JMail.Charset = "gb2312" 
JMail.MailServerUserName = E_ServerUser
JMail.MailServerPassword = E_ServerPass
JMail.ContentType = "text/html" 
JMail.Priority = 1 
JMail.From = E_SendManMail 
JMail.FromName = E_SendManName 
JMail.AddRecipient Email
JMail.Subject = mailtitle
JMail.Body = Mailbody
JMail.Send (E_Server)
JMail.Close() 
Set JMail = Nothing 


Else

'IIS自帶方法

Set objMail = Server.CreateObject("CDO.Message") 
Set objConfig = Server.CreateObject ("CDO.Configuration") 
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = E_Server 
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = E_ServerUser
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = E_ServerPass
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/languagecode") = "0x0804"
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
objConfig.Fields.Update() 
Set objMail.Configuration = objConfig
objMail.Subject = mailtitle
objMail.From = chr(34) & E_SendManName & chr(34) & E_SendManMail 
objMail.To = Email
objMail.HTMLBody = Mailbody
objMail.Send

objConfig.Close() 
Set objConfig = Nothing
objMail.Close() 
Set objMail = Nothing


End If


End Sub 

'-----------------------------------------------------------發(fā)送電子郵件結(jié)束
%>

[Top]
2 樓Time:2016/5/25 0:44:41
江西藍(lán)佰實業(yè)有限公司
  • 等級:注冊會員
  • 注冊:2016-05-25
  • Y幣:15 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
復(fù)制代碼保存成 Getpass.asp
放到網(wǎng)站的user文件夾下。
然后自己到要用的地方加個超連接就可以了

[Top]
3 樓Time:2016/6/25 21:54:57
WuyuE
  • 等級:注冊會員
  • 注冊:2016-02-26
  • Y幣:2 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
根本不行啊

[Top]
4 樓Time:2016/6/27 21:29:44
江西藍(lán)佰實業(yè)有限公司
  • 等級:注冊會員
  • 注冊:2016-05-25
  • Y幣:15 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
注意自己的網(wǎng)站空間是不是支持  JMail方法
支持的話,就把代碼
SendEmail email,sitetitle&"-找回密碼",zw,2
改成
SendEmail email,sitetitle&"-找回密碼",zw,1

這個方面不要用QQ郵箱,可以用163之類的,同時你自己要去郵箱中開通 smtp 功能。

[Top]
5 樓Time:2016/6/27 21:42:48
江西藍(lán)佰實業(yè)有限公司
  • 等級:注冊會員
  • 注冊:2016-05-25
  • Y幣:15 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
163郵箱 開通SMTP
登錄你的163郵箱之后,點設(shè)置 - POP3/SMTP/IMAP  勾選 POP3/SMTP服務(wù) 保存即可。



注意:E_ServerPass = "發(fā)件人郵箱登錄密碼" ''登錄密碼
這個地方的一般開通了郵箱的 POP3/SMTP服務(wù) 后,郵箱要求你設(shè)置或是直接給了你一個授權(quán)碼或者發(fā)信密碼之類的,   這里的 發(fā)件人郵箱登錄密碼 就必需寫給的這個密碼。

郵箱公司這么設(shè)計就是怕你的網(wǎng)站源代碼泄露,那別人就可以登錄你的郵箱了,有了授權(quán)碼就不會泄露登錄密碼,郵箱就保住了。

-------------------------------
IIS自帶CDO.Message組件能用的話是可以用QQ郵箱的。
我的就是用這種方法。

[Top]
6 樓Time:2016/7/5 22:02:22
晨夕
  • 等級:注冊會員
  • 注冊:2016-07-05
  • Y幣:2 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
Microsoft VBScript 編譯器錯誤 錯誤 '800a0409'

未結(jié)束的字符串常量

/user/getpass.asp,行 20

Call Alert ("璇瘋緭鍏ョ數(shù)瀛愰偖綆?,"-1")
--------------------^

[Top]
7 樓Time:2016/7/5 22:03:26
晨夕
  • 等級:注冊會員
  • 注冊:2016-07-05
  • Y幣:2 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?

UserName = CheckStr(trim(request.form("UserName")))
email = CheckStr(trim(request.form("email")))

if UserName="" then
Call Alert ("請輸入用戶名","-1")
end if
if email="" then
Call Alert ("請輸入電子郵箱","-1")   行 20
End if

Set rst = Server.CreateObject("ADODB.Recordset")
rst.Open "Select [username],[email] From ["&tbname&"_User] where Email='" &email&"' and username='" &UserName&"'" , conn, 1,3
if rst.bof then
Call Alert ("用戶名或郵箱錯誤!","-1")
End if
rst.close
set rst=nothing

[Top]
8 樓Time:2016/7/6 23:53:42
江西藍(lán)佰實業(yè)有限公司
  • 等級:注冊會員
  • 注冊:2016-05-25
  • Y幣:15 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
你這是網(wǎng)頁文件代碼格式錯誤。
老Y是 gb2312 格式的。
你在保存的ASP文件的時候,不能保存 成 UTF-8格式的文件。

[Top]
9 樓Time:2016/7/6 23:56:51
江西藍(lán)佰實業(yè)有限公司
  • 等級:注冊會員
  • 注冊:2016-05-25
  • Y幣:15 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
用記事本保存文件,一般是選擇 ANSI編碼 保存

[Top]
10 樓Time:2016/9/14 17:47:28
小小乾坤路
  • 等級:注冊會員
  • 注冊:2016-08-28
  • Y幣:40 元
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
并沒什么用吧,收不到找回郵件

51電視刷機網(wǎng)www.51tvrom.com提供全面的智能電視ROM固件下載、機頂盒固件下載、第三方固件下載、官方刷機升級救磚固件下載,覆蓋主流的海信電視件,TCL電視固件,康佳電視固件,長虹電視固件,樂視電視固件,暴風(fēng)TV固件等等品牌固件,體驗一站式刷機升級救磚服務(wù),體驗到刷機帶來的樂趣。
[Top]

 
  標(biāo)題:  
內(nèi)容:
  104.221.132.82

購買咨詢

QQ:97065691
商業(yè)技術(shù)支持

QQ:22862559

QQ:3978698