%OPTION EXPLICIT%> <% dim Msg, Success, rs, Email Email = trim(Request("Email")) WriteHeader if Request("Submit") = "" then WriteForm else FindUser if Success then SendTheMail if Success then WriteMessage else WriteForm end if else WriteForm end if end if WriteFooter sub SendTheMail dim Body Body = GetTemplate("Forgot.txt") Body = Replace(Body, "[PASSWORD]", rs("vPassword")) Body = Replace(Body, "[NAME]", rs("vFirstname") & " " & rs("vLastname")) if SendMail(rs("vEmail"), rs("vFirstname") & " " & rs("vLastname"), conFromAddress, conFromName, "aviation.org - Your Login credentials", Body) then Success = true else Success = false Msg = "Oops - there was an error processing your email message. Please try again in a few moments." end if rs.close set rs = nothing end sub sub FindUser Success = true if not IsEmail(Email) then Success = false Msg = "Please enter a valid email address." exit sub end if DBConnect set rs = cn.Execute("select vFirstname, vEmail, vPassword, vLastname from Users where vEmail = '" & SQLSafe(Email) & "'") if rs.eof then Msg = "Sorry, the email address does not exist in our database." Success = false rs.close set rs = nothing end if end sub sub WriteMessage %>
Your login credentials has been sent to the specified email account.
Please check your mail in a few minutes. <% end sub sub WriteHeader %>
|
Did you forget your password? <% end sub sub WriteForm %>Enter the email address with which you registered on aviation.org, and we will send the password to that email account. <% end sub sub WriteFooter %> |