저는 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
%>
을 Response.Write의 rs_user ("비밀번호")를 호출 sSendReminder 위. 가치가 보이십니까? –
가 다시 나타납니다. 나는 당신을 얻지 못한다. – blay
나는 response.write를 사용하여 페이지에 암호를 쓸 수 있지만 메일 본문에 보낼 수 없다. – blay