Link to home
Start Free TrialLog in
Avatar of lwillis32
lwillis32

asked on

ASP Error 0134

I have a Windows 2003 SBS Server on which I am running our corporate web site.  This site is primarily used by our customers for ordering office supplies.  The order form is set up to send an email to the customer service department with the details of the customer's order.  However, whenever the Submit button is clicked, the following error is generated in the IIS logs:

ASP Error 0134

Invalid_ProgID_Attribute

The URL is www.officeonetonertown.com/sample1.htm which posts the information to www.officeonetonertown.com/sample1.asp (code follows).

<%@ Language=VBScript %>
<html>
<head>
</head>
<body>
<%
Dim iMsg
Set iMsg = CreateObject("CDO.Message") 'calls CDO message COM object
Dim iConf
Set iConf = CreateObject("CDO.Configuration") 'calls CDO configuration COM object
Dim Flds
Set Flds = iConf.Fields
Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.algx.net"
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds.Update 'updates CDO's configuration database

Set iMsg.Configuration = iConf 'sets the configuration for the message
iMsg.To = Request.Form.Item("Email") 'could also be "webmaster@domain.com"
iMsg.From = "ezorder@officeonetonertown.com" 'must be "someone@domain.com"
iMsg.Subject = Request.Form.Item("Subject") 'could also be "complaint about website"
iMsg.TextBody = Request.Form.Item("EContent")
iMsg.Send 'commands CDO to send the message
%>
</body>
</html>


This code works on a Windows XP Pro computer running IIS, but I can't get it to work on this server.  We are not using most of the additional products that come with SBS since this is a very small company (i.e. - SQL, Exchange, SharePoint, etc.).

Any help you can provide will be most appreciated.

Lisa
Avatar of Slimshaneey
Slimshaneey
Flag of United Kingdom of Great Britain and Northern Ireland image

Change your code to ASP compliant code, your code looks like VB...

<%@ Language=VBScript %>
<html>
<head>
</head>
<body>
<%
Dim iMsg
Set iMsg = Server.CreateObject("CDO.Message") 'calls CDO message COM object
Dim iConf
Set iConf = Server.CreateObject("CDO.Configuration") 'calls CDO configuration COM object
Dim Flds
Set Flds = iConf.Fields
Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.algx.net"
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds.Update 'updates CDO's configuration database

Set iMsg.Configuration = iConf 'sets the configuration for the message
iMsg.To = Request.Form.Item("Email") 'could also be "webmaster@domain.com"
iMsg.From = "ezorder@officeonetonertown.com" 'must be "someone@domain.com"
iMsg.Subject = Request.Form.Item("Subject") 'could also be "complaint about website"
iMsg.TextBody = Request.Form.Item("EContent")
iMsg.Send 'commands CDO to send the message
%>
</body>
</html>
Note the CreateObject is changed to Server.CreateObject
ASKER CERTIFIED SOLUTION
Avatar of jitganguly
jitganguly

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
I noticed another error in there... use this code instead::

<%@ Language=VBScript %>
<html>
<head>
</head>
<body>
<%
Dim iMsg
Set iMsg = Server.CreateObject("CDO.Message") 'calls CDO message COM object
Dim iConf
Set iConf = Server.CreateObject("CDO.Configuration") 'calls CDO configuration COM object
Dim Flds
Set Flds = iConf.Fields
Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "ark-nt04.c.virtualit.biz"
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds.Update 'updates CDO's configuration database

iMsg.Configuration = iConf 'sets the configuration for the message
iMsg.To = "mail@soconnor.co.uk" 'could also be "webmaster@domain.com"
iMsg.From = "ezorder@officeonetonertown.com" 'must be "someone@domain.com"
iMsg.Subject = "hsQ" 'could also be "complaint about website"
iMsg.TextBody = "jsdklasjd"
iMsg.Send 'commands CDO to send the message
%>
</body>
</html>
Oops! Posted code with test details in there to make sure it was working...
Use this:
<%@ Language=VBScript %>
<html>
<head>
</head>
<body>
<%
Dim iMsg
Set iMsg = Server.CreateObject("CDO.Message") 'calls CDO message COM object
Dim iConf
Set iConf = Server.CreateObject("CDO.Configuration") 'calls CDO configuration COM object
Dim Flds
Set Flds = iConf.Fields
Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.algx.net"
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds.Update 'updates CDO's configuration database

iMsg.Configuration = iConf 'sets the configuration for the message
iMsg.To = Request.Form.Item("Email") 'could also be "webmaster@domain.com"
iMsg.From = "ezorder@officeonetonertown.com" 'must be "someone@domain.com"
iMsg.Subject = Request.Form.Item("Subject") 'could also be "complaint about website"
iMsg.TextBody = Request.Form.Item("EContent")
iMsg.Send 'commands CDO to send the message
%>
</body>
</html>
I also recommend removing Line 1 from Global.asa as You prob will not use it in your site. I think its put there by default by Interdev or something like that.
Avatar of lwillis32
lwillis32

ASKER

Thanks jitganguly, you hit the nail on the head.  I downloaded the myinfo.dll and registered it - BAM, everything worked like a charm.

Lisa
Cool.
Thanks for 'A'
Still has this error
CDO.Message.1 error '8004020c'

At least one recipient is required, but none were found.

/sample1.asp, line 23

This line is faulty
iMsg.To = Request.Form.Item("Email") 'could also be "webmaster@domain.com"

make sure Request.Form.Item("Email") has a value.You could also do some validations like

if not isnull(Request.Form("Email")) or len(Request.Form("Email")) > 0 Then
iMsg.To = Request.Form("Email")
end if
Thanks, but how do I send a message to the customer that this field is required?

Lisa
You will have to write a Javascript code on the form.In your case thta would be a previous page.

Post me the page before that
Okay, here is the code for the orderform.htm.  It looks as if the original creator of this site put in some checks for empty fields, but not the email field.

<html>

<head>
  <title>Office One - Toner Town</title>
  <meta name="Microsoft Border" content="none, default">
</head>

<body background="images/marble.jpg" link="#4980B6" vlink="#72738D" alink="#00FFFF">
<div align="center"><center>

<table border="1" width="60%">
  <tr>
    <td width="100%">
    <img src="images/header.jpg" alt="header.jpg (19565 bytes)" width="657" height="87"></td>
  </tr>
</table>
</center></div><div align="center"><center>

<table border="0" width="675" cellpadding="5" height="744">
  <tr>
    <td width="98" bgcolor="#C2D2D8" height="98" align="left"><a href="index.htm"><strong>Home</strong></a></td>
    <td width="537" bgcolor="#F2F7F9" rowspan="4" valign="top" height="1027"><p align="center"><big><big><strong>Order
    Form</strong></big></big></p>
    <dl>
      <script Language="JavaScript"><!--
function FrontPage_Form1_Validator(theForm)
{
  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }
  return (true);
}
//--></script>


<form method="POST" action="_derived/nortbots.htm" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-action="--WEBBOT-SELF--" WEBBOT-onSubmit>
  <!--webbot bot="SaveResults" U-File="Orders.txt" S-Format="TEXT/TSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Email-Format="TEXT/PRE" S-Email-Address="ezorder@officeonetonertown.com" B-Email-Label-Fields="TRUE" B-Email-ReplyTo-From-Field="TRUE" S-Email-ReplyTo="Email" B-Email-Subject-From-Field="FALSE" S-Email-Subject="Online Order" S-Date-Format="%B %d, %Y" S-Time-Format="%I:%M:%S %p" S-Builtin-Fields="Date Time" U-Confirmation-Url="OrderConfirmation.htm" startspan --><strong>[FrontPage Save Results Component]</strong><!--webbot bot="SaveResults" i-checksum="6561" endspan --><table border="0" width="103%" cellspacing="0" cellpadding="0">
          <tr>
            <td width="23%">Company Name</td>
            <td width="80%"><input type="text" name="CompanyName" size="48"></td>
          </tr>
          <tr>
            <td width="23%">Purchase Order #</td>
            <td width="80%"><input type="text" name="PurchaseOrderNum" size="20">&nbsp; Date <input type="text" name="Date" size="16"> </td>
          </tr>
          <tr>
            <td width="23%">Address</td>
            <td width="80%"><input type="text" name="Address" size="48"></td>
          </tr>
          <tr>
            <td width="23%">City</td>
            <td width="80%"><input type="text" name="City" size="23" value="Houston">State
              <input type="text" name="State" size="5" value="TX">&nbsp; Zip
              <input type="text" name="Zip" size="8"></td>
          </tr>
          <tr>
            <td width="23%">Phone</td>
            <td width="80%"><input type="text" name="Phone" size="12">&nbsp; Ext. <input type="text" name="PhoneExtension" size="5">&nbsp; Fax <input type="text" name="Fax" size="13"></td>
          </tr>
          <tr>
            <td width="23%">Contact Name</td>
            <td width="80%"><input type="text" name="ContactName" size="48"></td>
          </tr>
          <tr>
            <td width="23%">Email</td>
            <td width="80%"><input type="text" name="Email" size="48"></td>
          </tr>
          <tr>
            <td width="23%">Comments </td>
            <td width="80%"><textarea rows="2" name="Comments" cols="47"></textarea></td>
          </tr>
        </table>
        <dl>
          <div align="center"><center><table border="0" width="102%" cellspacing="0" cellpadding="0">
            <tr>
              <td width="10%"></td>
              <td width="19%">Quantity</td>
              <td width="36%">Stock #</td>
              <td width="51%">Description</td>
            </tr>
            <tr>
              <td width="10%">1</td>
              <td width="19%"><input type="text" name="Item1Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item1StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item1Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">2</td>
              <td width="19%"><input type="text" name="Item2Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item2StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item2Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">3</td>
              <td width="19%"><input type="text" name="Item3Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item3StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item3Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">4</td>
              <td width="19%"><input type="text" name="Item4Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item4StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item4Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">5</td>
              <td width="19%"><input type="text" name="Item5Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item5StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item5Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">6</td>
              <td width="19%"><input type="text" name="Item6Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item6StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item6Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">7</td>
              <td width="19%"><input type="text" name="Item7Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item7StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item7Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">8</td>
              <td width="19%"><input type="text" name="Item8Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item8StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item8Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">9</td>
              <td width="19%"><input type="text" name="Item9Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item9StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item9Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">10</td>
              <td width="19%"><input type="text" name="Item10Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item10StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item10Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">11</td>
              <td width="19%"><input type="text" name="Item11Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item11StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item11Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">12</td>
              <td width="19%"><input type="text" name="Item12Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item12StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item12Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">13</td>
              <td width="19%"><input type="text" name="Item13Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item13StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item13Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">14</td>
              <td width="19%"><input type="text" name="Item14Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item14StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item14Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">15</td>
              <td width="19%"><input type="text" name="Item15Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item15StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item15Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">16</td>
              <td width="19%"><input type="text" name="Item16Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item16StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item16Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">17</td>
              <td width="19%"><input type="text" name="Item17Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item17StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item17Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">18</td>
              <td width="19%"><input type="text" name="Item18Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item18StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item18Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">19</td>
              <td width="19%"><input type="text" name="Item19Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item19StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item19Description" size="40" value=" "></td>
            </tr>
            <tr>
              <td width="10%">20</td>
              <td width="19%"><input type="text" name="Item20Quantity" size="5"></td>
              <td width="36%"><input type="text" name="Item20StockNo" size="18"></td>
              <td width="51%"><input type="text" name="Item20Description" size="40" value=" "></td>
            </tr>
          </table>
          </center></div>
        </dl>
        <div align="center"><center><p><input type="submit" value="Submit" name="B1">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" value="Reset" name="B2"></p>
        </center></div>
      </form>
    </dl>
    <p align="center"><strong>We Accept:<br>
    <img src="images/CreditCard_Logos.gif" alt="CreditCard Logos.gif (1438 bytes)" width="153" height="34"></strong></p>
    <p align="center"><strong>Office One - Toner Town<br>
    </strong>7301 Fulton<br>
    Houston, TX 77022<br>
    Voice: (713) 697-2916 Fax: (713) 697-4521<br>
    E-mail: <a href="mailto:ezorder@officeonetonertown.com">ezorder@officeonetonertown.com</a></td>
  </tr>
  <tr align="center">
    <td width="98" bgcolor="#C2D2D8" align="left" height="98"><strong><a href="http://www.biggestbook.com/catalog_nondhtml.asp">Online Catalog</a></strong></td>
  </tr>
  <tr align="center">
    <td width="98" bgcolor="#C2D2D8" align="left" height="98"><strong><a href="contact.htm">Contact Us</a></strong></td>
  </tr>
  <tr align="center">
    <td width="98" height="681" align="left"><font color="#FFFFFF">.</font></td>
  </tr>
</table>
</center></div>

<p align="center"><strong><font face="Arial" color="#5F7A89"><big>MWBE</big><br>
<small>Minority/Womens' Business Enterprise</small></font></strong></p>
</body>
</html>

Lisa
Lisa,
You already have some client side javascript validations, Just add Email validation there like

Here is the only javacript portion with Email validtions

 <script Language="JavaScript"><!--
function FrontPage_Form1_Validator(theForm)
{
  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }
  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }
  return (true);
}
//--></script>



One thing , very important, Javascript is case sensitive. So
this statement
  if (theForm.Email.value == "") //Note email is first letter capital rest is small
is different than
  if (theForm.email.value == "") // Note email is all small
Okay, thanks so much for all of your help.

Lisa
Sure.U r welcome