|
am trying to adapt it to use with JMAil.
When you input a Username in the form it posts to another page and should retrieve the password. When I test it I get:
Microsoft VBScript compilation error '800a03ee'
Expected ')'
/asp_secure_login_development/forgotten_password2.asp, line 6
If (Request.Form(uaUsername") <> "") Then"
---------------------------^
I really can't see what I am doing wrong. The code for the page is:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/connUsers.asp" -->
<%
Dim rsRetrievePassword__MMColParam
rsRetrievePassword__MMColParam = "x"
If (Request.Form(uaUsername") <> "") Then
rsRetrievePassword__MMColParam = Request.Form(uaUsername")
End If
%>
<% If Trim(Request.Form("submit")) <> "" Then %>
<%
Dim rsRetrievePassword
Dim rsRetrievePassword_numRows
Set rsRetrievePassword = Server.CreateObject("ADODB.Recordset")
rsRetrievePassword.ActiveConnection = MM_connUsers_STRING
rsRetrievePassword.Source = "SELECT uaEmail,uaFirstname,uaPassword FROM tblUsers WHERE uaUsername = '" + Replace(rsRetrievePassword__MMColParam, "'", "''") + "'"
rsRetrievePassword.CursorType = 0
rsRetrievePassword.CursorLocation = 2
rsRetrievePassword.LockType = 1
rsRetrievePassword.Open()
rsRetrievePassword_numRows = 0
%>
<%
Dim var_done
var_done = "0"
If Not rsRetrievePassword.EOF Or Not rsRetrievePassword.BOF Then
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "mail.mydomain.net:25"
JMail.Sender = "me@mydomain.net"
JMail.Subject = "Your Username and Password"
JMail.AddRecipient (rsRetrievePassword.Fields.Item("email").Value)
JMail.Body = "Your user information is below as requested:." & vbCrLf & vbCrLf
JMail.Body = JMail.Body & "User Name : " &(rsRetrievePassword.Fields.Item("email").Value ) & vbCrLf
JMail.Body = JMail.Body & "Password : " &(rsRetrievePassword.Fields.Item("email").Value ) & vbCrLf
JMail.Body = JMail.Body & "You may now use these to log on."
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Execute
var_done = "1"
End If
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Your password has been e-mailed to you.</title>
<link href="stylesheets/main.css" rel="stylesheet" type="text/css">
<meta http-equiv="refresh" content="3;URL=index.asp">
</head>
<body>
<div align="center">
<p class="heading1">Your password has been e-mailed to the e-mail address which you registered with. </p>
</div>
</body>
</html>
<% If Trim(Request.Form("submit")) <> "" Then %>
<%
rsRetrievePassword.Close()
Set rsRetrievePassword = Nothing
%>
<% End If %>
|