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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email & ASP question

Status
Not open for further replies.

LaPluma

Programmer
Feb 3, 2002
139
DE
Hello

I have a web page with a form on it. When the visitor completes the form, the submit button calls another page to say 'Thank you + name'.

What I would like to do now is 'capture' all the information which the user inputs (name, country, email address, etc) and to be able to send it to an e.mail address of my choice.

In addition, it would be useful to be able to send the person who has completed the form a confirmation e.mail.

Are either (or both) these things possible in ASP?

Thank you for any input.
 
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
Response.write lastname & &quot;Thank you for using our email page&quot;
else
%>
<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>
<%
end if
%>

Regards,
Durug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top