%
Dim RS
Dim SQL
Dim Username
Dim Password
Dim Result
Dim Field
Dim JMail
Dim StudentEmail
Dim ParentEmail
Username = Request.Form("Username")
Email = Request.Form("Email")
If Username <> "" And Email <> "" Then
Set RS = Server.CreateObject("ADODB.RecordSet")
SQL = "SELECT * FROM Users WHERE (Username = '" & Username & _
"' AND (StudentEmail = '" & Email & "' OR ParentEmail = '" & Email & "'))"
RS.Open SQL, Application("CHINA_ConnectionString"), 2, 2
If RS.EOF Then
Result = Result & "ERROR: Username not found, or e-mail address is incorrect."
Else
StudentEmail = RS("StudentEmail")
ParentEmail = RS("ParentEmail")
Randomize
Password = CInt(Rnd * 100000)
RS("Password") = Password
RS.Update
RS.Close
Set RS = Nothing
Set JMail = Server.CreateObject("JMail.SMTPMail")
' This is my local SMTP server
JMail.ServerAddress = "xl1.xlstar.com:25"
' This is me....
JMail.Sender = "jwarrick@ntjazz.com"
JMail.Subject = "New Password"
' Get the recipients mailbox from a form (note the lack of a equal sign).
JMail.AddRecipient StudentEmail
JMail.AddRecipient ParentEmail
JMail.Body = "Your new password is: " & vbCrLf & vbCrLf & Password & _
vbCrLf & vbCrLf & "You received this e-mail because you requested that your password be reset at http://ntjazz.com/chinatour/bulletinboard" & _
vbCrLf & vbCrLf & "If you did not request that you password be reset, do not be alarmed. Your new password has only been sent to your e-mail address. You should use this new password to access the Bulletin Board from now on."
JMail.Execute
Set JMail = Nothing
Response.Redirect "password_end.asp"
End If
RS.Close
Set RS = Nothing
End If
%>
China Tour 2000: Bulletin Board