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!

ASP complete novice

Status
Not open for further replies.

Huitzilopochtli

Programmer
Feb 18, 2002
81
DE
Hello

I have spent most of my free time learning VB and Java, but need to start to get a grip on ASP.

In particular, I have a Web site with a form on it. When the person submits the form (which asks him for his e.mail address and name), is there a way - using ASP - that I can call an HTML page which thanks him, by name, for his input and sends an e.mail message to the address he has given on the form?

For instance, if Joe Bloggs completes the form with Joe@Bloggs.com and presses submit, can ASP send a page to his browser thanking Joe Bloggs for complting the form and confirming this by sending a message to Joe@Bloggs.com?

How can I do that in ASP (if it's possible in the first place)?

Many thanks to all.

Best wishes


 
HEre is the code that you requested. Of course you have to have IIS (or PWS) installed and SMTP Server started on the machine where this page will be located

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top