0
我正在與asp的項目工作,我有一個用戶忘記了他或她的密碼,她輸入她的電子郵件的一部分,如果它是有效的,它發送密碼。現在的問題是,它能夠檢查電子郵件是否在數據庫中,併發送郵件,但無法一起發送密碼。發送密碼,如果用戶忘記
<%
'Check if the form has been processed
If Request.Form("process")="true" Then
'Check the recordset for a valid record
If Not rs_user.Eof Then
'Valid record, so proceed with the email
Call sSendReminder (rs_user("email"), rs_user("password"))
Response.Write "Your password has been sent to your inbox. If you don't find it in your mail box, check your junk mail folder"
dim sName, sEmail, sMessage
dim oCdoMail, oCdoConf, sConfURL
sEmail = Request.Form("email")
Set oCdoMail = Server.CreateObject("CDO.Message")
Set oCdoConf = Server.CreateObject("CDO.Configuration")
sConfURL = "http://schemas.microsoft.com/cdo/configuration/"
with oCdoConf
.Fields.Item(sConfURL & "sendusing") = 2
.Fields.Item(sConfURL & "smtpserver") = "smptserveraddress.com"
.Fields.Item(sConfURL & "smtpserverport") = 25
.Fields.Update
end with
with oCdoMail
.From = "[email protected]"
.To = sEmail
.Subject = "Password Recovery from samplesite"
.TextBody = "Your password is: " & password
.HTMLBody = "Your password is: " & password
.Configuration = oCdoConf
.Send
end with
Set oCdoConf = Nothing
Set oCdoMail = Nothing
Else
'Not a valid record
Response.Write "Sorry, no email was found."
End If
End If
Sub sSendReminder(email, password)
End Sub
%>
回覆於rs_user( 「密碼」)上面呼叫sSendReminder。你看到價值了嗎? – 2014-09-26 22:18:34
再來。我沒有得到你 – blay 2014-09-26 22:24:55
我現在得到你,與response.write它能夠寫在頁面上的密碼,但不能發送郵件的正文 – blay 2014-09-27 00:30:14