Click to See Complete Forum and Search --> : invalid class string


simflex
06-09-2003, 01:54 PM
hi everyone!
I created a login page.
In this page, I want to give users the opportunity to retrieve an old password if sh/e can't remember his/her password.
So I created a page called "forgottenpassword.asp"
This page basically asks for your email address; if your email address is verified to accurate, and it is still in an active status, then your forgotten password will be emailed to you.
I am getting an invalid class string error.
Does anyone know what is causing this error or how to fix it.
I have verified that I have an smpt server running.
Here is the complete error text.
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string

Thanks for the help in advance.

khaki
06-09-2003, 02:58 PM
si simflex...

is the error occuring when you are checking the database for the existence of a valid email address...
or when replying with the password via email?

(and maybe some code would make this less of a dance :) )

;) k

cmelnick
06-09-2003, 03:01 PM
All that means is that your server doesn't know what type of object you are trying to create. That could mean that your server doesn't support that type of object, or that you typed the name wrong. For example,
myVar = Server.CreateObject("fhqwgahds")
would give that error.

What type of object are you trying to create? Post some code?

simflex
06-09-2003, 04:50 PM
hi khaki and cmelnick, here are some code!
khaki, the error occurs when I attempt to send user's email.
There is an exception handler for the email on the database.
That works fine.

<%
dim strEmail
strEmail = Request.Form("Email")

IF strEmail <> "" THEN

'-- Create object and open database
Set DataConnection = Server.CreateObject("ADODB.Connection")
DataConnection.Open "dsn=confirm"

dim mySQL, objRS
mySQL = "SELECT myEmail,Password FROM logins WHERE myEmail = '" & strEmail & "'"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, DataConnection

IF objRS.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 = objRS("Password")

dim mail, objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "sam.okeh@co.fulton.ga.us"
objMail.Subject = "Password"
objMail.To = strEmail
objMail.Body = "Here is your login password: " & strEmail
objMail.Send
Set objMail = nothing

Response.Write "Your password has been sent to your email address."
END IF

ELSE
Response.Write "Please click Back on your browser and enter the email address you registered with."
END IF
%>

cmelnick
06-09-2003, 05:17 PM
Don't mean to ask dumb questions, but you're sure you have both ADODB and CDONTS components installed and working on the server? That error doesn't have anything to do with invalid e-mail addresses or not finding a record in the table. It only has to do with the fact that the server is unable to create an ADODB.Connection, ADODB.Recordset, or CDONTS.NewMail object. There might be a line number assoc. with that error which should help you figure out which one is installed incorrectly (or not at all). If there is no line number, just do a Response.Write before each one to see how far it is getting.

simflex
06-09-2003, 05:26 PM
no such thing as a dumb question.
The offending line is this line:
Set objMail = Server.CreateObject("CDONTS.NewMail")

I did try to reinstall our smtp server this morning, assuming that is the problem.
I will look into it again just to ensure I am not leaving anything to chance.
Thanks for you folk's help!!!

Ribeyed
06-09-2003, 05:33 PM
HI Simflex,
what version of windows are you using?

simflex
06-09-2003, 05:47 PM
Hi Ribeyed!
I got it resolved!
Thanks again, everyone!!!

khaki
06-09-2003, 05:50 PM
hi simflex...

can you post the outcome?
(it helps those who may have been following this thread)

thanks...
;) k

simflex
06-09-2003, 10:08 PM
hi khaki!
Sorry I hadn't checked this thread since my last post.
About this code, nothing has changed from what we have now on this forum.
The only thing I did was recheck to ensure that I did infact install smtp and that it was installed correctly.
Once I made sure that was correct, the code started working.
I must say that there is another page to it.
page one is called passwordCheck.asp that asks for the client's email address, gets it and posts to confirm.asp (page2).
<html>
<head>
<title>Sending a password to user</title>
</head>
<body>
<form name="password" action="confirm.asp" method="post">
<table>
<tr>
<td>Please enter your email address:</td>
<td><input type="text" name="Email" value="">
<input type="submit" name="submit" value="Submit">
</td>
</tr>
</table>
</body>
</html>
Of course you can customize/extend the functionality.
Hope this is what you asked for.
-s