View Single Post
Old 01-19-2006   #2 (permalink)
thecubed
Yup, that's meee!
 
thecubed's Avatar
 
Join Date: Jun 2004
Location: Infront of my screen (most of the time)
Posts: 89

Send a message via AIM to thecubed Send a message via Yahoo to thecubed Send a message via Skype™ to thecubed
Ok, I assume that you want to have all the contents of that form emailed to your email address... there are plenty of ASP form-mail scripts out there, and credits goes to tele-pro.co.uk for this script.

In your code that you posted, change the default.asp to mail.asp and save this code as mail.asp
Code:
<%
' Website Contact Form Generator 
' http://www.tele-pro.co.uk/scripts/contact_form/ 
' This script is free to use as long as you  
' retain the credit link  

' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Tel
Dim Comment

' get posted data into variables
EmailFrom = Trim(Request.Form("email")) 
EmailTo = "--INSERT YOUR PRIVATE EMAIL ADDRESS HERE--"
Subject = "yoursubject"
Name = Trim(Request.Form("name")) 
Tel = Trim(Request.Form("tel")) 
Comment = Trim(Request.Form("comment")) 

' validation
Dim validationOK
validationOK=true
If (Trim(EmailFrom)="") Then validationOK=false
If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)

' prepare email body text
Dim Body
Body = Body & "Email From: " & EmailFrom & VbCrLf
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Telephone: " & Tel & VbCrLf
Body = Body & "Comment: " & Comment & VbCrLf

' send email 
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail") 
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send 

' redirect to success page 
Response.Redirect("ok.htm?" & EmailFrom)
%>
then change the line with the insert your email address here to where you would like the email sent to when you click the form send button.
that should do it
__________________

www.thecubed.com <--- TheCubed Homepage!
thecubed is offline