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