Hi Guys,
Was wondering if somebody on the forums could help me with a problem with a web form.
I have a simple form on a HTML page, all code below. Trouble is, its got to be uploaded with the rest of the site onto an asp server which doesnt support CDONTS, only CDOSYS. I'm told the .asp file I have used uses the now extinct CDONTS. All I need is for the info entered into the form fields (name, email add, phone no, comments) to send to a specified email address.
I'm guessing I need a valid .asp file to upload with the site. Please please help!!
Lucy
My html code for the form is;
<form method="POST" action="contact.asp">
<p>Name:<br>
<input type="text" name="Name">
<p>Email Address: <br>
<input type="text" name="EmailFrom">
<p>PhoneNumber:<br>
<input type="text" name="PhoneNumber">
<p>Comments:<br>
<textarea name="Comments"></textarea>
<p><input class="red" type="submit" name="submit" value="SEND">
</form>
<p>
...........and my .asp file code is;
<%
' Website Contact Form Generator
' Website Contact Form Generator - ASP, PHP, CGI Email Form Scripts
' 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 PhoneNumber
Dim Comments
' get posted data into variables
EmailFrom = Trim(Request.Form("EmailFrom"))
EmailTo = "sales@vanquishcarhire.co.uk"
Subject = "Website Booking Form"
Name = Trim(Request.Form("Name"))
PhoneNumber = Trim(Request.Form("PhoneNumber"))
Comments = Trim(Request.Form("Comments"))
' 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 & "Name: " & Name & VbCrLf
Body = Body & "PhoneNumber: " & PhoneNumber & VbCrLf
Body = Body & "Comments: " & Comments & 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)
%>
I hope this is enough info for somebody to make sense of....any help would be much appreciated!