%@Language = VBScript%> <%Option Explicit%> <% FUNCTION invalidEmail(email) IF INSTR (email,"@")=0 OR INSTR(email,".")=0 THEN invalidEmail=TRUE ELSE invalidEmail=FALSE END IF END FUNCTION Dim firstname, lastname, email, subject, comment, yesno, strError %> <% IF Request.QueryString("submit") = "1" THEN firstname = Request.Form("firstname") IF firstname = "" THEN strError = "You did not enter your first name." END IF lastname = Request.Form("lastname") IF lastname = "" THEN strError = "You did not enter your last name." END IF email = Request.Form("email") 'IF NOT invalidEmail(email) THEN IF invalidEmail(email) THEN strError = "You did not enter a valid email address." END IF subject = Request.Form("subject") IF subject = "" THEN strError = "You did not select a subject." END IF comment = Request.Form("comment") IF comment = "" THEN strError = "You did not enter a comment." END IF IF strError = "" THEN Dim JMail, emailmsg, thing, msg emailmsg = "" for each thing in request.form emailmsg = emailmsg & trim(thing) & ": " & trim(request.form(thing)) & vbcrlf next set msg = Server.CreateOBject( "JMail.Message" ) msg.Logging = true msg.silent = false msg.From = request.form("email") msg.AddRecipient "rodney@rodneyrabbit.com" 'Recipient of emailed form msg.Subject = "Completed Form for Rodney" 'Subject of Email msg.Body = cstr(emailmsg) msg.Send( "www8.redstation.co.uk" ) 'Change this to www2, www3 etc response.redirect "thankyou.htm" 'address of thank you page END IF END IF %>
| Welcome to RodneyRabbit.com | ||||||||||||||||||
| |
||||||||||||||||||
|
|
|
||||||||||||||||||||||
Site
hosting organised by Creational
Design |
| RodneyRabbit does not take any responsibility for any consequences incurred as a result of any advice given on this website |