程序討論版須知: 在使用老y文章管理系統(tǒng)中的一些問(wèn)題!對(duì)非本程序方面的問(wèn)題恕不解答!對(duì)Html,css等基礎(chǔ)問(wèn)題恕不解答!如果沒(méi)有HTML基礎(chǔ)請(qǐng)先自學(xué)HTML! 需要打開(kāi)你網(wǎng)站才能看出問(wèn)題的請(qǐng)留下網(wǎng)址,并請(qǐng)保留本站版權(quán)及友情鏈接,否則不予回復(fù)。 |
|
![]() ![]() ![]() ![]()
|
樓主Time:2016/5/25 0:36:21 | |
![]() ![]()
|
添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
<!--#include file="../Inc/conn.asp"--> <!--#include file="../Inc/md5.asp"--> <% If useroff=0 then Call Alert("網(wǎng)站目前已經(jīng)關(guān)閉會(huì)員功能","../") 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 ("請(qǐng)輸入用戶名","-1") end if if email="" then Call Alert ("請(qǐng)輸入電子郵箱","-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 ("用戶名或郵箱錯(cuò)誤!","-1") End if rst.close set rst=nothing '------------生成隨機(jī)密碼------------- Randomize Do While Len(pass)<8 '隨機(jī)密碼位數(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 '------------生成隨機(jī)密碼------------- 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>您的臨時(shí)新密碼為<font color='red'>"&pass&"</font>,請(qǐng)盡快登錄本站修改密碼。<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">請(qǐng)?zhí)顚?xiě)你的用戶名和注冊(cè)時(shí)填寫(xiě)的郵箱,系統(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 這里寫(xiě)發(fā)件服務(wù)器" ''發(fā)件服務(wù)器 E_ServerUser = "發(fā)件人郵箱登錄名" ''登錄用戶名 E_ServerPass = "發(fā)件人郵箱登錄密碼" ''登錄密碼 E_SendManMail = "這里寫(xiě)發(fā)件人的郵箱地址" ''發(fā)件人郵件地址 E_SendManName = "這里寫(xiě)發(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 | |
![]() ![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
復(fù)制代碼保存成 Getpass.asp
放到網(wǎng)站的user文件夾下。 然后自己到要用的地方加個(gè)超連接就可以了 |
[Top] |
3 樓Time:2016/6/25 21:54:57 | |
![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
根本不行啊
|
[Top] |
4 樓Time:2016/6/27 21:29:44 | |
![]() ![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
注意自己的網(wǎng)站空間是不是支持 JMail方法
支持的話,就把代碼 SendEmail email,sitetitle&"-找回密碼",zw,2 改成 SendEmail email,sitetitle&"-找回密碼",zw,1 這個(gè)方面不要用QQ郵箱,可以用163之類的,同時(shí)你自己要去郵箱中開(kāi)通 smtp 功能。 |
[Top] |
5 樓Time:2016/6/27 21:42:48 | |
![]() ![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
163郵箱 開(kāi)通SMTP
登錄你的163郵箱之后,點(diǎn)設(shè)置 - POP3/SMTP/IMAP 勾選 POP3/SMTP服務(wù) 保存即可。 注意:E_ServerPass = "發(fā)件人郵箱登錄密碼" ''登錄密碼 這個(gè)地方的一般開(kāi)通了郵箱的 POP3/SMTP服務(wù) 后,郵箱要求你設(shè)置或是直接給了你一個(gè)授權(quán)碼或者發(fā)信密碼之類的, 這里的 發(fā)件人郵箱登錄密碼 就必需寫(xiě)給的這個(gè)密碼。 郵箱公司這么設(shè)計(jì)就是怕你的網(wǎng)站源代碼泄露,那別人就可以登錄你的郵箱了,有了授權(quán)碼就不會(huì)泄露登錄密碼,郵箱就保住了。 ------------------------------- IIS自帶CDO.Message組件能用的話是可以用QQ郵箱的。 我的就是用這種方法。 |
[Top] |
6 樓Time:2016/7/5 22:02:22 | |
![]() ![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
Microsoft VBScript 編譯器錯(cuò)誤 錯(cuò)誤 '800a0409'
未結(jié)束的字符串常量 /user/getpass.asp,行 20 Call Alert ("璇瘋緭鍏ョ數(shù)瀛愰偖綆?,"-1") --------------------^ |
[Top] |
7 樓Time:2016/7/5 22:03:26 | |
![]() ![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
UserName = CheckStr(trim(request.form("UserName"))) email = CheckStr(trim(request.form("email"))) if UserName="" then Call Alert ("請(qǐng)輸入用戶名","-1") end if if email="" then Call Alert ("請(qǐng)輸入電子郵箱","-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 ("用戶名或郵箱錯(cuò)誤!","-1") End if rst.close set rst=nothing |
[Top] |
8 樓Time:2016/7/6 23:53:42 | |
![]() ![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
你這是網(wǎng)頁(yè)文件代碼格式錯(cuò)誤。
老Y是 gb2312 格式的。 你在保存的ASP文件的時(shí)候,不能保存 成 UTF-8格式的文件。 |
[Top] |
9 樓Time:2016/7/6 23:56:51 | |
![]() ![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
用記事本保存文件,一般是選擇 ANSI編碼 保存
|
[Top] |
10 樓Time:2016/9/14 17:47:28 | |
![]() ![]()
|
RE:添加 找回密碼 功能,重置密碼發(fā)送到郵箱,不知道能不能發(fā)表?
并沒(méi)什么用吧,收不到找回郵件
|
51電視刷機(jī)網(wǎng)www.51tvrom.com提供全面的智能電視ROM固件下載、機(jī)頂盒固件下載、第三方固件下載、官方刷機(jī)升級(jí)救磚固件下載,覆蓋主流的海信電視件,TCL電視固件,康佳電視固件,長(zhǎng)虹電視固件,樂(lè)視電視固件,暴風(fēng)TV固件等等品牌固件,體驗(yàn)一站式刷機(jī)升級(jí)救磚服務(wù),體驗(yàn)到刷機(jī)帶來(lái)的樂(lè)趣。 |
|
[Top] |