I'm using the following code to auto generate an email to users that have forgotten a logon password.
<%
Dim rsEmail__strEmail
rsEmail__strEmail = "1"
If (Request.Form("Email") <> "") Then
rsEmail__strEmail = Request.Form("Email")
End If
%>
<%
Dim rsEmail
Dim rsEmail_numRows
Set rsEmail = Server.CreateObject("ADODB.Recordset")
rsEmail.ActiveConnection = MM_DBConn_STRING
rsEmail.Source = "SELECT Email,Pswrd FROM dbo.tblLogin WHERE Email = '" +
Replace(rsEmail__strEmail, "'", "''") + "'"
rsEmail.CursorType = 0
rsEmail.CursorLocation = 2
rsEmail.LockType = 1
rsEmail.Open()
rsEmail_numRows = 0
IF rsEmail.EOF THEN
Response.Write "That email address was not found in our database. Please
click Back on your browser and enter the email address you registered with."
ELSE
DIM strPassword
strPassword = rsEmail("Pswrd")
sch =
http://schemas.microsoft.com/cdo/configuration/
mailbody = "Here is your login password: " & rsEmail__strEmail
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "mail.softscience.com"
.update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "dwayneepps@response.com"
.To = rsEmail__strEmail
.Subject = "Dwayne-Epps-Weblog-Password-Request"
.HTMLBody = mailbody
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
Response.Write "Your password has been sent to your email address."
%>
<%
rsEmail.Close()
Set rsEmail = Nothing
End If
%>
The strange thing is that if I test the above script on my local testing
server it will work if I use the following line without quotations marks:
sch =
http://schemas.microsoft.com/cdo/configuration/
In order for the script to work in the production environment I have to add
quotation marks like so:
sch = "http://schemas.microsoft.com/cdo/configuration/"
Any idea as to what the difference is and why this happens? This is the
only thing that I have to change for it to work on the remote production
server? I'd like to understand why so I can correct it to work the same on
both my local testing server and the remote production server. Thanks for any help.
-Dman100-