Link to home
Start Free TrialLog in
Avatar of gferro
gferro

asked on

Having problem sending form data through an email

After I filling out a form I want to send the form's data by an email so I used the following code:

' Line 479 below
Set Mailer = Server.CreateObject("ASPMail.ASPMailCtrl.1")        

recipient = strTo
sender = strFrom
subject = "Crooked Creek Golf: Online Request for Reservation Form"
mailserver = "pop3.vnet.com.br"
message = strBody
result = Mailer.SendMail(mailserver, recipient, sender, subject, message)

But as a response I got a message error that is :

What should I do ?
Server object error 'ASP 0177 : 800401f3'
                   Server.CreateObject Failed
           /ListadeComprasFlushop.asp, line 479
                          Invalid class string
Avatar of manojamin
manojamin

try this...

Set Mailer = Server.CreateObject("ASPMail.ASPMailCtrl")  

also read this,
Here, There, and Virtually Anywhere
http://msdn.microsoft.com/workshop/essentials/webmen/webmen070698.asp

the text is below...

Dear Web Men:

We are an educational site that would like to make ASP files for our Web site so we can access databases and create active content. However, whenever we try to establish a connection with the database, we receive this error. We read through any help articles we could find on your site, but none of the suggestions seemed to work. We would appreciate any help that you can provide.

Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/Calendar/tblEvents.asp, line 16
Invalid class string
Ernest Dotson

The Web Men reply:

As the error message indicates, there seems to be a problem with the string you are passing to the CreateObject method. The string you pass to the method is the class name or ProgID (programmatic identifier) of the COM object you want to create. Whatever you are passing in the string is not a COM object that Active Server Pages (ASP) technology recognizes.

To access databases with ASP, you use ActiveX Data Objects (ADO). With ADO, you can create a connection to a database using a Connection object. The following ASP script shows how to create a Connection object:

<%
objConn = Server.CreateObject("ADODB.Connection")
%>
Once you create the Connection object, you use its Open method to create the connection the database.

Working with databases is described in the ASP tutorial included in the Internet Information Server (IIS) 4.0 documentation. Check out Lesson 3: Using the Database Access Component of Module 2: Using ActiveX Components. For more code examples, take a look at the Database Connectivity section in Developer Samples.

If you continue to run into problems, and you're sure your ASP script is correct, and your database is set up properly, you could run the Windows NT Option Pack setup program again, and reinstall the Microsoft Data Access Components.


Also make sure that you see this in the registry...

HKEY_CLASSES_ROOT\ASPMail.ASPMailCtrl

use regedit to check this...

Avatar of gferro

ASKER

I didn't understand what you meant with
 "Also make sure that you see this in the registry...
 HKEY_CLASSES_ROOT\ASPMail.ASPMailCtrl
use regedit to check this...  "

I've changed the code line
Avatar of gferro

ASKER

I didn't understand what you meant with
 "Also make sure that you see this in the registry...
 HKEY_CLASSES_ROOT\ASPMail.ASPMailCtrl
use regedit to check this...  "

I've changed the code line
All the ActiveX components are registered in the registry. The call that you are using,

Server.CreateObject("progID") looks into the registry under HKEY_CLASSES_ROOT hive.

over here, your program ID is "ASPMail.ASPMailCtrl", therefore, the CreateObject will go and check CLSID under this key,

HKEY_CLASSES_ROOT\ASPMail.ASPMailCtrl

Now, the CLSID value under

HKEY_CLASSES_ROOT\CLSID\{nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn}\

(where, n stands for hexadecimal number (could be from 0 to 9, and A- F))

will have all the necessary information for that dll, incuding the path of the dll, threading model, ProgID etc...

What I meant is that, check the registry and make sure that you are using the right ProgID key...

i.e. ASPMail.ASPMailCtrl

Also, check the ProgId's default value under

HKEY_CLASSES_ROOT\CLSID\{nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn}\

and make sure that value matches too... ignore any number after ASPMail.ASPMailCtrl.n (i.e. n, n stands for the current version number, you should not worry about that)


(where {nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn} is the CLSID (class ID) of your dll)

I hope this not confusing....
I believe you are trying to use the OCXmail ASP component. This component was developed by Flicks Software (http://www.flicks.com)(This web site was down last time I checked it). You have to buy and install this component before you can use it in your ASP page.

Check out these web pages
1)http://www.15seconds.com/component/pg002058.htm
2) http://www.15seconds.com/component/pg002853.htm

Alternatively, you can use other mailer components which are free.
I suggest using Dimac's w3 JMail component.

This is available through http://tech.dimac.net

ASKER CERTIFIED SOLUTION
Avatar of lui_ang
lui_ang

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial