Question

Updating a Win 2000 CDONTS script

Asked by: kirwood

This script worked on 2000 Server but not on 2003. How do I change it to work on 2003? What are the general principes for creating new scripts to run on 2003 Web Server?

<%
Dim usxCDO
Set usxCDO = Server.CreateObject("CDO.Newmail")
usxCDO.From = ""
usxCDO.To = "david@thebeacon.co.uk"
usxCDO.Subject = "Takeaway Order"
usxCDO.Body = Chr(13) & Chr(10) &_
"Base: " & cStr(Request("")) & Chr(13) & Chr(10) &_
"120Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
"70Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
"50Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
"FreeFill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
"Number Req'd: " & cStr(Request(""))
If (cStr(Request("Submit")) <> "") Then
usxCDO.Send
Set usxCDO = Nothing
Response.Redirect ""
End If
%>

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-02-09 at 11:30:45ID20878689
Tags

2003

,

cdonts

,

win

Topic

Windows 2003 Server

Participating Experts
2
Points
250
Comments
21

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. CDONTS on NT4 Workstation
    I have successfully written Code that utilises CDONTS and sends email after collecting information from a form that I developed on Windows 2000. Some of our clients are using Win NT4 Workstation with IIS as their web server. I know CDONTS is OK on Win NT4 Server. How do...
  2. CDONTS in VB6
    I have a quick question, I cannot find the object reference in VB6 for the CDONTS library. Can someone please direct me to this. I can only find CDO 1.2 library which is much different. Thanks. ch

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: TooKoolKrisPosted on 2004-02-09 at 11:32:40ID: 10313458

Microsoft Windows Server 2003 Does Not Install Collaboration Data Objects for NTS
http://support.microsoft.com/default.aspx?scid=kb;en-us;315197

 

by: ehammersleyPosted on 2004-02-09 at 12:45:11ID: 10314121

Try this, it should fix you up, maybe :-).  Don't forget to add your SMTP servers IP address below.  It's a little different if you want to use a drop directory instead of sending it via a local SMTP server.  I can send you that change if you need it.

Dim usxCDO

Set usxCDO= Server.CreateObject("CDO.Message")
     With usxCDO
          .From = ""
          .To = "david@thebeacon.co.uk"
          .Subject = "Takeaway Order"
          .TextBody = Chr(13) & Chr(10) &_
                            "Base: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                            "120Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                            "70Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                            "50Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                            "FreeFill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                             "Number Req'd: " & cStr(Request(""))
          .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "IP address of smtp server"
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
          .Configuration.Fields.Update
     End With
If (cStr(Request("Submit")) <> "") Then
usxCDO.Send
Response.Redirect ""
End If

 

by: kirwoodPosted on 2004-02-09 at 15:37:26ID: 10316412

That did not work in the sense that the page displayed but when the form was completed no mail was sent and the response redirect gave "page could not be displayed" message even though the page is normally visible.
Code for the complete page below

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim usxCDO

Set usxCDO= Server.CreateObject("CDO.Message")
     With usxCDO
          .From = cStr(Request("textfrom"))
          .To = "david@thebeacon.co.uk"
          .Subject = "Takeaway Order"
          .TextBody = Chr(13) & Chr(10) &_
                            "Base: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                            "120Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                            "70Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                            "50Fill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                            "FreeFill: " & cStr(Request("")) & Chr(13) & Chr(10) &_
                             "NumberReqd: " & cStr(Request(""))
          .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "194.72.71.150"
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
          .Configuration.Fields.Update
     End With
If (cStr(Request("Submit")) <> "") Then
usxCDO.Send
Response.Redirect "default.asp"
End If
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>&nbsp;</p>
<form action="" method="post" name="testorder" id="testorder">
<p>
  <input name="textfrom" type="text" id="textfrom">
</p>
<table width="99%" border="1">
  <tr>
    <td bgcolor="#FFFF99">Selection A</td>
    <td bgcolor="#FFFF99"><select name="Base" id="select2">
      <option value="White bread A" selected>White bread
      <option value="Brown bread A">Brown bread
      <option value="Baguette A">Baguette
      <option value="Panini A">Panini
    </select>
</td>
    <td bgcolor="#FFFF99"><select name="120Fill" size="1" id="select5">
      <option value="Nil">None
      <option value="Smoked Salmon A">Smoked Salmon
      <option value="Smoked Chicken A">Smoked Chicken
      <option value="Smoked Haddock A">Smoked Haddock
      <option value="Prawns A">Prawns
      <option value="Rare Roast Beef A">Rare Roast Beef
      <option value="Roast Pork A">Roast Pork
      <option value="Continental meats A">Continental meats
      <option value="Steak A">Steak
    </select>
</td>
    <td bgcolor="#FFFF99"><select name="70Fill" size="1" id="select">
        <option value="Nil">None
        <option value="Brie A">Brie
        <option value="Cheddar A">Cheddar
        <option value="Stilton A">Stilton
        <option value="Goat's cheese A">Goat's cheese
        <option value="Fried egg A">Fried egg
        <option value="Avocado A">Avocado
        <option value="Bacon A">Bacon
        <option value="Ham A">Ham
        <option value="Two sausages A ">Two sausages
      </select>
    </td>
    <td bgcolor="#FFFF99"><select name="50Fill" size="1" id="50Fill">
        <option value="Nil">None
        <option value="Boiled egg A">Boiled egg
        <option value="Cream cheese A">Cream cheese
        <option value="Sun blush tomatoes A">Sun blush tomatoes
        <option value="Chutney A">Chutney
        <option value="Olives A">Olives
      </select>
    </td>
    <td bgcolor="#FFFF99"><select name="FreeFill" size="1" id="select4">
        <option value="Nil">None
        <option value="Lettuce A">Lettuce
        <option value="Cucumber A">Cucumber
        <option value="Tomato A">Tomato
        <option value="Red onion A">Red onion
        <option value="Peppers A">Peppers
        <option value="Mayonnaise A">Mayonnaise
        <option value="English mustard A">English mustard
        <option value="Red Sauce A">Red Sauce
        <option value="Brown Sauce A">Brown Sauce
        <option value="Horseradish A">Horseradish
      </select>
    </td>
    <td bgcolor="#FFFF99"><input name="NumberReqd" type="text" id="Number Req'd2" size="3" maxlength="3"></td>
  </tr>
</table>
<p>
  <input type="submit" name="Submit" value="Submit">
</p>
</form>
<p>&nbsp;</p>
</body>
</html>

 

by: kirwoodPosted on 2004-02-09 at 15:39:12ID: 10316432

PS It's past my bedtime in the UK so I will check back tomorrow

 

by: ehammersleyPosted on 2004-02-09 at 20:30:32ID: 10319161

First off check and make sure you aren't in this boat.  The following article talks about a bug in 2k3 server with dcpromo.  Check and see if the IIS_WPG user has the permissions outlined in the KB article.  Most people have this problem.  A common effect of this bug is the generation of the following Event Log entry:

Event ID: 5

Error: The Template Persistent Cache initialization failed for Application Pool" DefaultAppPool: because of the following error: Could not create a Disk Cache Sub-directory for the Application Pool. The data may have additional error codes:

If you have that error in your Event Log you need this article.

http://support.microsoft.com/default.aspx?scid=kb;en-us;332097

If that doesn't help I'll have more to follow.

 

by: TooKoolKrisPosted on 2004-02-10 at 08:29:22ID: 10323488

I'm sorry but did anybody bother to read the article that I posted explaining how this isn't supported in 2003?

 

by: ehammersleyPosted on 2004-02-10 at 08:53:24ID: 10323734

Kirwood - I apologize that your posting is going to get jacked for a moment.

TKK,

Honestly did you bother to read it?  We can all post links, but do we understand them?  The problem is that he had a CDONTS script that wouldn't function on his new 2003 Server.  He asked how to make it work.  While posting a link stating that CDONTS isn't supported anymore is helpful the problem is that he needed a solution, not just a link.  The link provides that solution and the options available to make your old CDONTS scripts work, by converting them into the new CDOSYS namespace.  I don't have any problem with the way you approached it... the link was fine, but your last post wasn't necessary because it's not accurate and it's slightly insulting.

You are correct, Server 2003 does not support CDONTS, actually they hinted around this going away in Windows 2000 Server where they provided both options.  Now we only have one, CDOSYS.  Unless of course you want to hack around and move CDONTS over to your 2003 server.  While it will make CDONTS work many have debated EULA violations on this method, plus the obvious "band-aid" bad programming effect this causes.  The differences between a CDONTS script and a CDOSYS script are minor and require very little change at all.

Looking at the initial post you'll see that he calls a CDONTS object "CreateObject("CDO.NewMail").  This won't work on 2003 Server... since CDONTS is no longer available.  But...

If you look at the code in later posts you'll see it has been converted into the CDOSYS namespace shown most obviously by "CreateObject("CDO.Message").

Now, the new code is correct and compatable with 2003 Server.  He is experiencing a configuration issue at the moment, as best I can tell.  Thank you for listening.  I by no means intend this post to offend you, I simply want you to see what is really going on.

 

by: kirwoodPosted on 2004-02-10 at 11:29:44ID: 10325273

Thanks guys. I much prefer a proper long term solution to a band aid. As well as an immediate solution I hoped I would get a framework that would help me in the future  create new scripts under Win 2003.

So if the code is now correct what do you mean by "configuration issue" and how may this be resolved. Do you mean the way I have configured IIS6?

 

by: ehammersleyPosted on 2004-02-10 at 11:36:41ID: 10325356

No, I didn't mean you did anything wrong.  When I re-wrote the script in CDOSYS I tested it and it functioned properly.  I was concerned about a configuration issue because you were unable to get it running.  One thing I forgot to mention was that you needed to add your select names to your script under the email body.  ie. "Base: " & cStr(Request("")) needs to have Base added between the quotes for (Request("")) and so on.

Did you check the KB article for the configuration bug from DCPROMO I posted above?

Can you spell out exactly what is happening when you run the page now w/ any error numbers (500, 403.1, etc.)?

Thanks

 

by: kirwoodPosted on 2004-02-11 at 07:48:54ID: 10333210

I have filled in the """". Sorry, I should have seen that.
Unfortunately it makes no difference. No mailis sent and no page displayed. Error message 500 Internal server error.

I have checked the KB. All the IIS settings were as per the article.

 

by: kirwoodPosted on 2004-02-11 at 12:17:33ID: 10335790

OK, after much fiddling around http://www.thatchedcottage.info/testorder3.asp  works.

On the page you can see other places where I would like input values but if I add them the script fails.It does not make any sense to me.
 Here is the code for http://www.thatchedcottage.info/testorder2.asp which includes them.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim usxCDO

Set usxCDO= Server.CreateObject("CDO.Message")
     With usxCDO
          .From = cStr(Request("textfrom"))
          .To = "enquiries@thatchedcottage.info"
          .Subject = "Takeaway Order"
          .TextBody = Chr(13) & Chr(10) &_
                                            "Name: " & cStr(Request("name")) & Chr(13) & Chr(10) &_
                                          "Phone: " & cStr(Request("phone")) & Chr(13) & Chr(10) &_
                                          "Collection Time: " & cStr(Request("timeReqd")) & Chr(13) & Chr(10) &_
                            "Base: " & cStr(Request("Base")) & Chr(13) & Chr(10) &_
                            "120Fill: " & cStr(Request("120Fill")) & Chr(13) & Chr(10) &_
                            "70Fill: " & cStr(Request("70Fill")) & Chr(13) & Chr(10) &_
                            "50Fill: " & cStr(Request("50Fill")) & Chr(13) & Chr(10) &_
                            "FreeFill: " & cStr(Request("FreeFill")) & Chr(13) & Chr(10) &_
                             "NumberReqd: " & cStr(Request("NumberReqd"))
          .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup" ' Or("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "194.72.71.150"
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
          .Configuration.Fields.Update
     End With
If (cStr(Request("Submit")) <> "") Then
usxCDO.Send
Response.Redirect "default.asp"
End If
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>&nbsp;</p>
<form action="testorder2.asp" method="post" name="testorder" id="testorder">
<p>&nbsp;</p>
<table width="50%" border="0">
  <tr>
    <td width="54%">Your Name</td>
    <td width="46%"><input name="name" type="text" id="name"></td>
  </tr>
  <tr>
    <td>Your Email</td>
    <td><input name="textfrom" type="text" id="textfrom"></td>
  </tr>
  <tr>
    <td>Your Telephone</td>
    <td><input name="phone" type="text" id="phone" size="14" maxlength="14"></td>
  </tr>
  <tr>
    <td>Collection Time Required</td>
    <td><input name="timeReqd" type="text" id="timeReqd" size="14" maxlength="14"></td>
  </tr>
</table>
<br>
<table width="99%" border="1">
  <tr>
    <td bgcolor="#FFFF99">Selection A</td>
    <td bgcolor="#FFFF99"><select name="BaseA" id="select2">
      <option value="White bread A" selected>White bread
      <option value="Brown bread A">Brown bread
      <option value="Baguette A">Baguette
      <option value="Panini A">Panini
    </select>
</td>
    <td bgcolor="#FFFF99"><select name="120FillA" size="1" id="select7">
      <option value="Nil">None
      <option value="Smoked Salmon A">Smoked Salmon
      <option value="Smoked Chicken A">Smoked Chicken
      <option value="Smoked Haddock A">Smoked Haddock
      <option value="Prawns A">Prawns
      <option value="Rare Roast Beef A">Rare Roast Beef
      <option value="Roast Pork A">Roast Pork
      <option value="Continental meats A">Continental meats
      <option value="Steak A">Steak
    </select></td>
    <td bgcolor="#FFFF99"><select name="70FillA" size="1" id="select">
        <option value="Nil">None
        <option value="Brie A">Brie
        <option value="Cheddar A">Cheddar
        <option value="Stilton A">Stilton
        <option value="Goat's cheese A">Goat's cheese
        <option value="Fried egg A">Fried egg
        <option value="Avocado A">Avocado
        <option value="Bacon A">Bacon
        <option value="Ham A">Ham
        <option value="Two sausages A ">Two sausages
      </select>
    </td>
    <td bgcolor="#FFFF99"><select name="50FillA" size="1" id="50Fill">
        <option value="Nil">None
        <option value="Boiled egg A">Boiled egg
        <option value="Cream cheese A">Cream cheese
        <option value="Sun blush tomatoes A">Sun blush tomatoes
        <option value="Chutney A">Chutney
        <option value="Olives A">Olives
      </select>
    </td>
    <td bgcolor="#FFFF99"><select name="FreeFillA" size="1" multiple id="select6">
      <option value="Nil">None
      <option value="Lettuce A">Lettuce
      <option value="Cucumber A">Cucumber
      <option value="Tomato A">Tomato
      <option value="Red onion A">Red onion
      <option value="Peppers A">Peppers
      <option value="Mayonnaise A">Mayonnaise
      <option value="English mustard A">English mustard
      <option value="Red Sauce A">Red Sauce
      <option value="Brown Sauce A">Brown Sauce
      <option value="Horseradish A">Horseradish
    </select>
</td>
    <td bgcolor="#FFFF99"><input name="NumberReqdA" type="text" id="Number Reqd" size="3" maxlength="3"></td>
  </tr>
</table>
<p>
  <input type="submit" name="Submit" value="Submit">
</p>
</form>
<p>&nbsp;</p>
</body>
</html>

 

by: TooKoolKrisPosted on 2004-02-11 at 12:36:29ID: 10335938

Whatever, the point is that its not supported so you can fool around with code all day if you want. I didn't realize you were so timid as to being insulted I say grow some dam skin.

 

by: ehammersleyPosted on 2004-02-11 at 12:59:28ID: 10336126

TKK,

This is the LAST time I'm telling you this.  After this your can click the Unsubscribe button if you do not agree.  Your posts are already unprofessional and against what EE stands for, in my opinion.  Now, let me break it down for you.

Kirwood requested assistance making a CDONTS script work on his 2003 server.  You advised him that CDONTS was not supported, which is correct, and provided him with a link supporting that statement.  What you failed to mention is that by converting his CDONTS script to conform to the "new" CDOSYS namespace and methods it could and will continue to work.  This was clearly pointed out in the link that you posted.  I followed up by converting the script for him into CDOSYS format and posted the code.  All of this is fine to this point, nothing is wrong with the thread.  Now, you post that we obviously didn't read your post and once again state that it isn't supported in 2003.  You seem to be stuck on the notion that we are still talking about CDONTS, which we are not.  This clearly indicates to me that you do not have a grasp on what is going on.  

This is Experts Exchange, not a Solo side show.  If your opinion or thought doesn't match that of another post, or expert, then you should either research their standpoint and see if you are in fact right or you unsubscribe.  If you are right then post your findings so the other people involved can check their work.  This bantering you seem to be spewing in this thread is unacceptable.

If you have solid information then post it, if not...

Kirwood - I'm sorry your post got jacked again.

 

by: ehammersleyPosted on 2004-02-11 at 13:09:11ID: 10336224

Kirwood,

I received no errors on those scripts remotely.  They both directed me to default upon submit.  I hope you didn't mind but I assumed that's why you posted the public links.

What error are you receiving on testorder2 and are you using the same email settings on both pages (ie. the pickup folder or IP)  The code at first glance looks fine although I've never used pickup and IP under mail settings before.  Not saying it doesn't work... I've just never done it.  I'll double check that syntax in a little bit and post if it is off.

Thanks

 

by: ehammersleyPosted on 2004-02-11 at 16:26:19ID: 10337791

kirwood,

The following code paste works for me.  Only a few minor changes, mainly to the request fills in the message body.  I've tested it several times (Windows 2003 IIS 6) and all result in a successful email drop.  It looks good here... let me know how it turns out for you.  The only big things was that you renamed your text fills but didn't carry them up to the message body.  Other than that it functioned correctly.

-- Begin Cut--

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim usxCDO

Set usxCDO= Server.CreateObject("CDO.Message")
     With usxCDO
          .From = cStr(Request("textfrom"))
          .To = "enquiries@thatchedcottage.info"
          .Subject = "Takeaway Order"
          .TextBody = Chr(13) & Chr(10) &_
                      "Name: " & cStr(Request("name")) & Chr(13) & Chr(10) &_
                      "Phone: " & cStr(Request("phone")) & Chr(13) & Chr(10) &_
                      "Collection Time: " & cStr(Request("timeReqd")) & Chr(13) & Chr(10) &_
                      "Base: " & cStr(Request("BaseA")) & Chr(13) & Chr(10) &_
                      "120Fill: " & cStr(Request("120FillA")) & Chr(13) & Chr(10) &_
                      "70Fill: " & cStr(Request("70FillA")) & Chr(13) & Chr(10) &_
                      "50Fill: " & cStr(Request("50FillA")) & Chr(13) & Chr(10) &_
                      "FreeFill: " & cStr(Request("FreeFillA")) & Chr(13) & Chr(10) &_
                      "NumberReqd: " & cStr(Request("NumberReqdA"))
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup" ' Or("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "10.0.0.3"
          .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
          .Configuration.Fields.Update
     End With
If (cStr(Request("Submit")) <> "") Then
usxCDO.Send
Response.Redirect "default.asp"
End If
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>&nbsp;</p>
<form action="testorder2.asp" method="post" name="testorder" id="testorder">
<p>&nbsp;</p>
<table width="50%" border="0">
  <tr>
    <td width="54%">Your Name</td>
    <td width="46%"><input name="name" type="text" id="name"></td>
  </tr>
  <tr>
    <td>Your Email</td>
    <td><input name="textfrom" type="text" id="textfrom"></td>
  </tr>
  <tr>
    <td>Your Telephone</td>
    <td><input name="phone" type="text" id="phone" size="14" maxlength="14"></td>
  </tr>
  <tr>
    <td>Collection Time Required</td>
    <td><input name="timeReqd" type="text" id="timeReqd" size="14" maxlength="14"></td>
  </tr>
</table>
<br>
<table width="99%" border="1">
  <tr>
    <td bgcolor="#FFFF99">Selection A</td>
    <td bgcolor="#FFFF99"><select name="BaseA" id="select2">
      <option value="White bread A" selected>White bread
      <option value="Brown bread A">Brown bread
      <option value="Baguette A">Baguette
      <option value="Panini A">Panini
    </select>
</td>
    <td bgcolor="#FFFF99"><select name="120FillA" size="1" id="select7">
      <option value="Nil">None
      <option value="Smoked Salmon A">Smoked Salmon
      <option value="Smoked Chicken A">Smoked Chicken
      <option value="Smoked Haddock A">Smoked Haddock
      <option value="Prawns A">Prawns
      <option value="Rare Roast Beef A">Rare Roast Beef
      <option value="Roast Pork A">Roast Pork
      <option value="Continental meats A">Continental meats
      <option value="Steak A">Steak
    </select></td>
    <td bgcolor="#FFFF99"><select name="70FillA" size="1" id="select">
        <option value="Nil">None
        <option value="Brie A">Brie
        <option value="Cheddar A">Cheddar
        <option value="Stilton A">Stilton
        <option value="Goat's cheese A">Goat's cheese
        <option value="Fried egg A">Fried egg
        <option value="Avocado A">Avocado
        <option value="Bacon A">Bacon
        <option value="Ham A">Ham
        <option value="Two sausages A ">Two sausages
      </select>
    </td>
    <td bgcolor="#FFFF99"><select name="50FillA" size="1" id="50Fill">
        <option value="Nil">None
        <option value="Boiled egg A">Boiled egg
        <option value="Cream cheese A">Cream cheese
        <option value="Sun blush tomatoes A">Sun blush tomatoes
        <option value="Chutney A">Chutney
        <option value="Olives A">Olives
      </select>
    </td>
    <td bgcolor="#FFFF99"><select name="FreeFillA" size="1" multiple id="select6">
      <option value="Nil">None
      <option value="Lettuce A">Lettuce
      <option value="Cucumber A">Cucumber
      <option value="Tomato A">Tomato
      <option value="Red onion A">Red onion
      <option value="Peppers A">Peppers
      <option value="Mayonnaise A">Mayonnaise
      <option value="English mustard A">English mustard
      <option value="Red Sauce A">Red Sauce
      <option value="Brown Sauce A">Brown Sauce
      <option value="Horseradish A">Horseradish
    </select>
</td>
    <td bgcolor="#FFFF99"><input name="NumberReqdA" type="text" id="Number Reqd" size="3" maxlength="3"></td>
  </tr>
</table>
<p>
  <input type="submit" name="Submit" value="Submit">
</p>
</form>
<p>&nbsp;</p>
</body>
</html>

 

by: ehammersleyPosted on 2004-02-11 at 16:30:14ID: 10337810

kirwood,

I also just saw where the initial problem was, that you have now repaired.  The form action was blank.  :-)  I guess both of us should have caught that one sooner.  Of course that was several posts ago.  I think the code posted now should do ya just fine.

 

by: ehammersleyPosted on 2004-02-11 at 16:32:52ID: 10337825

Really not much difference between the old CDONTS code and the new CDOSYS code.  :-)  Shuffle the namespace around and call it a new product.  MS style.

 

by: kirwoodPosted on 2004-02-11 at 16:44:43ID: 10337932

Thanks for you patience, that now works OK and gives me a good basis for new scripts. Great job!

 

by: ehammersleyPosted on 2004-02-11 at 17:13:56ID: 10338198

No problem.  I'm glad it worked out.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...