Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Beginner Problems

Reply
Thread Tools

Beginner Problems

 
 
simchajoy2000@yahoo.com
Guest
Posts: n/a
 
      01-03-2006
Hi,

This question will probably be too simplistic for all of you, but I am
trying to teach myself asp and I am having all sorts of problems. I
have a simple html form which calls process.asp on submit:

<html>
<head></head>
<body>
<form action="process.asp" method=Post>
<table cellpadding="0" cellspacing="5" align=center>
<tr>
<td width="100"><font color="#1B157F">Name:</font></font></td>
<td><input type="text" name="txtName" size="55"></td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit Now">
</form>
</body>
</html>

I want my process.asp page to display the name the user entered and
then to send an email containing the information. Here is what I have
so far for the process.asp page:

<html>
<head></head>
<body>
<%
Dim strEmail

Dim strName
strName = Request.Form("txtName")
Response.Write strName

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From = "(E-Mail Removed)"
MyCDONTSMail.To = "(E-Mail Removed)"
MyCDONTSMail.Subject = "Get-A-Quote Request from " & strName
MyCDONTSMail.Body = MyBody
MyCDONTSMail.Send
Set MyCDONTSMail = Nothing
%>
</body>
</html>

I am not trying to get this to run on a webserver at this point. I am
just trying to get it run in a regular folder on my computer. I
thought that might be the reason why I wasn't receiving any email but
then the Response.Write doesn't work either. When I don't add the html
tags I get a message that asks if I want to save or open the
process.asp page instead of just running it.

A little help? I'm obviously missing something . . . any advice would
be greatly appreciated!

Thank you!

Joy

 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      01-03-2006
Hi Joy,

No, you're off to a fine start (aside from the fact that you're using 1990s
technology...). But ASP files MUST be processed by a Web server. You can
probably run this locally on your machine. What are the answers to these
questions:

1. What operating system are you running?
2. Do you have IIS installed, do you know?

Ray at home

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...


> I am not trying to get this to run on a webserver at this point. I am
> just trying to get it run in a regular folder on my computer. I
> thought that might be the reason why I wasn't receiving any email but
> then the Response.Write doesn't work either. When I don't add the html
> tags I get a message that asks if I want to save or open the
> process.asp page instead of just running it.
>
> A little help? I'm obviously missing something . . . any advice would
> be greatly appreciated!



 
Reply With Quote
 
 
 
 
simchajoy2000@yahoo.com
Guest
Posts: n/a
 
      01-03-2006
Thanks Ray,

I do have IIS installed and I am running Windows XP. However, the
webpage will not reside on my computer however. What do I need to do?

Joy

 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      01-04-2006
The web page ~will~ not but currently does? That's fine. That's normal.
In a default IIS setup, your "home page" for your site should reside in
C:\Inetpub\wwwroot. Put your ASP files there and test them by going to
http://localhost/yourpagename.asp

NOW, other things:

CDONTS = CDO for NT Server. You're running Windows XP. It does not have
CDONTS. If you installed the SMTP service when you installed IIS, you'll
have CDOSYS. Read this: http://www.aspfaq.com/show.asp?id=2026 Depending
on your setup where you're working, the e-mails may not actually be sent.
Like, if you're a bank teller playing with ASP files in between customers
and you start trying to relay e-mail from your site, it probably won't go.
Instead, you may wind up getting a call from a network admin asking why your
machine is trying to relay mail. I suggest that you just stop the SMTP
service and test the success of your ASP code by verifying that the mail was
placed in C:\Inetpub\mailroot\pickup, if it turns out that you cannot relay
mail from your machine.

Ray at home

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Thanks Ray,
>
> I do have IIS installed and I am running Windows XP. However, the
> webpage will not reside on my computer however. What do I need to do?
>
> Joy
>



 
Reply With Quote
 
simchajoy2000@yahoo.com
Guest
Posts: n/a
 
      01-04-2006
Thank you so much Ray, I have done as you instructed and I placed the
folder containing all my html and asp files in C:\Inetpub\wwwroot and
then I created a virtual directory in IIS that points to that folder (I
was supposed to do that right?) but when I say
http://localhost/yourpagename.asp - it says the page cannot be
displayed - do you have any idea what is wrong?

Thanks!

Joy

 
Reply With Quote
 
simchajoy2000@yahoo.com
Guest
Posts: n/a
 
      01-04-2006
Ok, silly me, I just needed to add the folder name to the path -
another question - I understand why the CDONTS doesn't work but
Response.Write doesn't work at all either. Can you tell from my code
if I am doing anything wrong?

Thanks!

Joy

 
Reply With Quote
 
Larry Bud
Guest
Posts: n/a
 
      01-04-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Thank you so much Ray, I have done as you instructed and I placed the
> folder containing all my html and asp files in C:\Inetpub\wwwroot and
> then I created a virtual directory in IIS that points to that folder (I
> was supposed to do that right?) but when I say
> http://localhost/yourpagename.asp - it says the page cannot be
> displayed - do you have any idea what is wrong?


If you're using IE, make sure in Internet Options that "Show Friendly
HTTP error messages" is turned OFF.

This way the browser will tell you exactly where the error is occurring
in the ASP. There could be a syntax error on line 1, and you'd never
know it.

 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      01-04-2006
Show us your current code that you have now, and what does "doesn't work"
mean? Do you get an error? What does it say? Do you get a blank page?

Also, did you read what I wrote about how CDONTS hasn't really been in vogue
since 1999?

Ray at home

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Ok, silly me, I just needed to add the folder name to the path -
> another question - I understand why the CDONTS doesn't work but
> Response.Write doesn't work at all either. Can you tell from my code
> if I am doing anything wrong?
>
> Thanks!
>
> Joy
>



 
Reply With Quote
 
firas489@gmail.com
Guest
Posts: n/a
 
      01-05-2006
Hello (E-Mail Removed),
About the CDOSYS as Ray Costanzo [MVP] said, he is correct, but in
addition when you declare and set the variable, i noticed that you
wrote Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
Its better to write Set MyCDONTSMail =
Server.CreateObject("CDONTS.NewMail")
I know that you might say that "what did u add the server, i doesn't
make any difference" but trust me, when u program using Microsoft
programs, everything is possible. For example once i was using
MapPath("Location.mdb") and always getting an error, but couldn't find
it, then i had an idea, which was to add server to the command, so it
looked like this Server.MapPath("Locatuo.mdb"), after that the page
worked propoply with no extra problem, and by the way when u click
Ctrl+Space in Microsoft Visual InterDev you will find that MapPath
works without the Server as well as the CreateObject.


Hope this helps


Best Regards
Firas S Assaad

 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      01-05-2006
(E-Mail Removed) wrote:
> Hello (E-Mail Removed),
> About the CDOSYS as Ray Costanzo [MVP] said, he is correct, but in
> addition when you declare and set the variable, i noticed that you
> wrote Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
> Its better to write Set MyCDONTSMail =
> Server.CreateObject("CDONTS.NewMail")



In older versions of IIS, this did make a difference. In newer versions, the
recommendation is to use the vbscript version of CreateObject, rather than
the version provided by the Server object. For more information, see:

http://blogs.msdn.com/ericlippert/ar...01/145686.aspx


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner's Beginner william nelson Ruby 7 04-11-2011 11:23 PM
Beginner begging: problems with Builder! JohnS C++ 6 06-09-2006 09:19 PM
Design problems (beginner) Michael Judge Ruby 2 01-26-2006 08:14 AM
No Class at ALL!!! beginner/beginner question =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?= ASP .Net 7 02-03-2005 02:47 PM
Tutorial for beginner/ Tutorial voor beginner Rensjuh C++ 7 09-02-2004 12:41 AM



Advertisments