Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Elle MacPherson 1

Status
Not open for further replies.

Huitzilopochtli

Programmer
Feb 18, 2002
81
DE
Hello

I have a mailing list form on my site which asks the visitor for his name and e.mail address.

In an ideal world I would like a page to load in the visitor's browser which says 'Thank you Elle MacPherson' (or whatever the visitor's name is) and 'an e.mail has been sent to your e.mail address', once the visitor has pressed the form's submit button.

Can ASP do this?

Many thanks for any advice.
 
Here is the code

File name = test.asp

<%
if Request.Form(&quot;firstentry&quot;) = &quot;First&quot; then
email = request.form(&quot;email&quot;)
lastname = Request.Form(&quot;lastname&quot;)
Dim MyMail
Set MyMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
MyMail.From = &quot;me@me.com&quot;
MyMail.To = email
MyMail.Subject = &quot;Thank you&quot;
MyMail.BodyFormat = 1
MyMail.MailFormat = 0
MyMail.Importance = 2
MyMail.Body = lastname & &quot;Thank you for using our email page&quot;
MyMail.Send
Set MyMail = Nothing
end if
%>
<html>
<body>
<form name=frmmain method=post action=test.asp>
<input type=hidden name=firstentry value='First'>
<input type= text name=email><br>
<input type= text name=lastname><br>
<input type=submit value=Send>
</form>
</body>
</html>

Regards,
Durug
 
Hello Durug

Well that's mighty kind of you!
Thank you very much indeed!

Best wishes

Huitzilopochtli

 
[tt]Psssssst.
I'll award durug a
star.gif
for ya.[/tt]

[flowerface]
 
[tt]Not Canadian at all.

I'm neither:
a [bandito] nor
a [cook] nor
a [conehead] nor
a [deejay] nor
a [[elf] nor
a [hippy] nor
a [indian] nor
a [king] nor
a [smilejap] nor
a [viking] nor
a [blues] brother nor
a [smurf] nor
a [trooper] nor
a [ghost] nor
a [vampire] nor
a [witch] nor
a [bat] nor
a [bull] nor
a [bunny] nor
a [chicken] nor
a [cow] nor
a [fish] nor
a guy with an [afro]
at all.

I'm Hispanic​

[/tt]


[flowerface]
 
Hello Durug

Once again thank you for your posting.

I have uploaded the code to a server (W.NT) and have put it on a site I use at:


I haven't altered the code in any way, but I might change the appearance of a couple of things later. I just wanted to ensure that it worked in principle, but having typed in the word 'Hello' in the first box and pressing 'Submit', I get this error message:

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/cgi-bin/test.asp, line 6

Invalid class string

Have you seen this error before?

Cheers and best wishes
 
Maybe your server doesn't have CDONTS enabled? That would be my guess. It is a module that has to be enabled on NT Server.

Also, why did you put the test.asp file in the /cgi-bin/ directory? Einstein47
(Love is like PI - natural, irrational, endless, and very important.)
 
Hello Einstein47

Many thanks for your posting.
I will need to check with the NT server that CDONTS is enabled. Thanks for your advice.
I placed test.asp in cgi-bin for no reason whatsoever. Should I upload the file to the same directory as my html pages?
Thanks again 47, much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top