Results 1 to 2 of 2

Thread: Complex Form ASP Submission

  1. #1
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Complex Form ASP Submission

    Hi,

    I'm looking to submit a complex form, found here:

    http://thedentalimplantclinic.com/referral.htm

    Currently I use FrontPage Server Extensions and thus have a Webbot submitting the form, but I want to switch to FTP and therefore need an easy way to submit this form to an email in a readable fashion. However, my webhost is 1&1 microsoft hosting, so the only scripting I can use is ASP. I have used an ASP script to submit a simple online enquiry form, found here but is there an easy way I can use it to submit the referral form?

    Alternatively, is there a free hosted solution or form builder I should be aware of?

    Thanks in advance for your help,
    Oli

  2. #2
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    This is the code I am trying:

    Code:
    <% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head> 
    <body>
    <% 
    Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
    Mail.FromName   = Request.Form("DentistName")
    Mail.FromAddress= Request.Form("DentistEmail")
    Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
    Mail.AddRecipient "Redacted" , "Redacted"
    Mail.Subject    = "Online Referral"
    Mail.BodyText   = "Practitioner -"
    Mail.BodyText   = " "
    Mail.BodyText   = "Name:"
    Mail.BodyText   = Request.Form("DentistName")
    Mail.BodyText   = " "
    Mail.BodyText   = "Email Address:"
    Mail.BodyText   = Request.Form("DentistEmail")
    Mail.BodyText   = " "
    Mail.BodyText   = "Address:"
    Mail.BodyText   = Request.Form("DentistStreetAddress")
    Mail.BodyText   = " "
    Mail.BodyText   = "Telephone:"
    Mail.BodyText   = Request.Form("DentistTelNo")
    Mail.BodyText   = " "
    Mail.BodyText   = "Patient -"
    Mail.BodyText   = " "
    Mail.BodyText   = "Name:"
    Mail.BodyText   = Request.Form("PatientName")
    Mail.BodyText   = " "
    Mail.BodyText   = "Email Address:"
    Mail.BodyText   = Request.Form("PatientEmail")
    Mail.BodyText   = " "
    Mail.BodyText   = "Address:"
    Mail.BodyText   = Request.Form("PatientStreetAddress")
    Mail.BodyText   = " "
    Mail.BodyText   = "Telephone:"
    Mail.BodyText   = Request.Form("PatientTelNo")
    Mail.BodyText   = " "
    Mail.BodyText   = "Implants:"
    If Request.Form("Implant_18") <> "" Then Mail.BodyText = "18"
    If Request.Form("Implant_17") <> "" Then Mail.BodyText = "17"
    If Request.Form("Implant_16") <> "" Then Mail.BodyText = "16"
    If Request.Form("Implant_15") <> "" Then Mail.BodyText = "15"
    If Request.Form("Implant_14") <> "" Then Mail.BodyText = "14"
    If Request.Form("Implant_13") <> "" Then Mail.BodyText = "13"
    If Request.Form("Implant_12") <> "" Then Mail.BodyText = "12"
    If Request.Form("Implant_11") <> "" Then Mail.BodyText = "11"
    If Request.Form("Implant_28") <> "" Then Mail.BodyText = "28"
    If Request.Form("Implant_27") <> "" Then Mail.BodyText = "27"
    If Request.Form("Implant_26") <> "" Then Mail.BodyText = "26"
    If Request.Form("Implant_25") <> "" Then Mail.BodyText = "25"
    If Request.Form("Implant_24") <> "" Then Mail.BodyText = "24"
    If Request.Form("Implant_23") <> "" Then Mail.BodyText = "23"
    If Request.Form("Implant_22") <> "" Then Mail.BodyText = "22"
    If Request.Form("Implant_21") <> "" Then Mail.BodyText = "21"
    If Request.Form("Implant_38") <> "" Then Mail.BodyText = "38"
    If Request.Form("Implant_37") <> "" Then Mail.BodyText = "37"
    If Request.Form("Implant_36") <> "" Then Mail.BodyText = "36"
    If Request.Form("Implant_35") <> "" Then Mail.BodyText = "35"
    If Request.Form("Implant_34") <> "" Then Mail.BodyText = "34"
    If Request.Form("Implant_33") <> "" Then Mail.BodyText = "33"
    If Request.Form("Implant_32") <> "" Then Mail.BodyText = "32"
    If Request.Form("Implant_31") <> "" Then Mail.BodyText = "31"
    If Request.Form("Implant_48") <> "" Then Mail.BodyText = "48"
    If Request.Form("Implant_47") <> "" Then Mail.BodyText = "47"
    If Request.Form("Implant_46") <> "" Then Mail.BodyText = "46"
    If Request.Form("Implant_45") <> "" Then Mail.BodyText = "45"
    If Request.Form("Implant_44") <> "" Then Mail.BodyText = "44"
    If Request.Form("Implant_43") <> "" Then Mail.BodyText = "43"
    If Request.Form("Implant_42") <> "" Then Mail.BodyText = "42"
    If Request.Form("Implant_41") <> "" Then Mail.BodyText = "41"
    Mail.BodyText   = " "
    Mail.BodyText   = "Extractions:"
    If Request.Form("Extraction_18") <> "" Then Mail.BodyText = "18"
    If Request.Form("Extraction_17") <> "" Then Mail.BodyText = "17"
    If Request.Form("Extraction_16") <> "" Then Mail.BodyText = "16"
    If Request.Form("Extraction_15") <> "" Then Mail.BodyText = "15"
    If Request.Form("Extraction_14") <> "" Then Mail.BodyText = "14"
    If Request.Form("Extraction_13") <> "" Then Mail.BodyText = "13"
    If Request.Form("Extraction_12") <> "" Then Mail.BodyText = "12"
    If Request.Form("Extraction_11") <> "" Then Mail.BodyText = "11"
    If Request.Form("Extraction_28") <> "" Then Mail.BodyText = "28"
    If Request.Form("Extraction_27") <> "" Then Mail.BodyText = "27"
    If Request.Form("Extraction_26") <> "" Then Mail.BodyText = "26"
    If Request.Form("Extraction_25") <> "" Then Mail.BodyText = "25"
    If Request.Form("Extraction_24") <> "" Then Mail.BodyText = "24"
    If Request.Form("Extraction_23") <> "" Then Mail.BodyText = "23"
    If Request.Form("Extraction_22") <> "" Then Mail.BodyText = "22"
    If Request.Form("Extraction_21") <> "" Then Mail.BodyText = "21"
    If Request.Form("Extraction_38") <> "" Then Mail.BodyText = "38"
    If Request.Form("Extraction_37") <> "" Then Mail.BodyText = "37"
    If Request.Form("Extraction_36") <> "" Then Mail.BodyText = "36"
    If Request.Form("Extraction_35") <> "" Then Mail.BodyText = "35"
    If Request.Form("Extraction_34") <> "" Then Mail.BodyText = "34"
    If Request.Form("Extraction_33") <> "" Then Mail.BodyText = "33"
    If Request.Form("Extraction_32") <> "" Then Mail.BodyText = "32"
    If Request.Form("Extraction_31") <> "" Then Mail.BodyText = "31"
    If Request.Form("Extraction_48") <> "" Then Mail.BodyText = "48"
    If Request.Form("Extraction_47") <> "" Then Mail.BodyText = "47"
    If Request.Form("Extraction_46") <> "" Then Mail.BodyText = "46"
    If Request.Form("Extraction_45") <> "" Then Mail.BodyText = "45"
    If Request.Form("Extraction_44") <> "" Then Mail.BodyText = "44"
    If Request.Form("Extraction_43") <> "" Then Mail.BodyText = "43"
    If Request.Form("Extraction_42") <> "" Then Mail.BodyText = "42"
    If Request.Form("Extraction_41") <> "" Then Mail.BodyText = "41"
    Mail.BodyText   = " "
    Mail.BodyText   = "Endodontics:"
    If Request.Form("Endo_18") <> "" Then Mail.BodyText = "18"
    If Request.Form("Endo_17") <> "" Then Mail.BodyText = "17"
    If Request.Form("Endo_16") <> "" Then Mail.BodyText = "16"
    If Request.Form("Endo_15") <> "" Then Mail.BodyText = "15"
    If Request.Form("Endo_14") <> "" Then Mail.BodyText = "14"
    If Request.Form("Endo_13") <> "" Then Mail.BodyText = "13"
    If Request.Form("Endo_12") <> "" Then Mail.BodyText = "12"
    If Request.Form("Endo_11") <> "" Then Mail.BodyText = "11"
    If Request.Form("Endo_28") <> "" Then Mail.BodyText = "28"
    If Request.Form("Endo_27") <> "" Then Mail.BodyText = "27"
    If Request.Form("Endo_26") <> "" Then Mail.BodyText = "26"
    If Request.Form("Endo_25") <> "" Then Mail.BodyText = "25"
    If Request.Form("Endo_24") <> "" Then Mail.BodyText = "24"
    If Request.Form("Endo_23") <> "" Then Mail.BodyText = "23"
    If Request.Form("Endo_22") <> "" Then Mail.BodyText = "22"
    If Request.Form("Endo_21") <> "" Then Mail.BodyText = "21"
    If Request.Form("Endo_38") <> "" Then Mail.BodyText = "38"
    If Request.Form("Endo_37") <> "" Then Mail.BodyText = "37"
    If Request.Form("Endo_36") <> "" Then Mail.BodyText = "36"
    If Request.Form("Endo_35") <> "" Then Mail.BodyText = "35"
    If Request.Form("Endo_34") <> "" Then Mail.BodyText = "34"
    If Request.Form("Endo_33") <> "" Then Mail.BodyText = "33"
    If Request.Form("Endo_32") <> "" Then Mail.BodyText = "32"
    If Request.Form("Endo_31") <> "" Then Mail.BodyText = "31"
    If Request.Form("Endo_48") <> "" Then Mail.BodyText = "48"
    If Request.Form("Endo_47") <> "" Then Mail.BodyText = "47"
    If Request.Form("Endo_46") <> "" Then Mail.BodyText = "46"
    If Request.Form("Endo_45") <> "" Then Mail.BodyText = "45"
    If Request.Form("Endo_44") <> "" Then Mail.BodyText = "44"
    If Request.Form("Endo_43") <> "" Then Mail.BodyText = "43"
    If Request.Form("Endo_42") <> "" Then Mail.BodyText = "42"
    If Request.Form("Endo_41") <> "" Then Mail.BodyText = "41"
    Mail.BodyText   = " "
    Mail.BodyText   = "Periodontal Disease:"
    If Request.Form("PerioLocalised") <> "" Then Mail.BodyText = "PerioLocalised"
    If Request.Form("PerioGeneralised") <> "" Then Mail.BodyText = "PerioGeneralised"
    If Request.Form("PerioRegeneration") <> "" Then Mail.BodyText = "PerioRegeneration"
    If Request.Form("PeriImplantitis") <> "" Then Mail.BodyText = "PeriImplantitis"
    If Request.Form("PeriGingivalRegression") <> "" Then Mail.BodyText = "PerioGingivalRegression"
    If Request.Form("PerioCrownLengthening") <> "" Then Mail.BodyText = "PerioCrownLengthening"
    If Request.Form("PerioGummySmile") <> "" Then Mail.BodyText = "PerioGummySmile"
    If Request.Form("PerioOther") <> "" Then Mail.BodyText = Request.Form("PerioOtherDetails")
    Mail.BodyText   = " "
    Mail.BodyText   = Request.Form("Other")
    
    if Mail.SendMail then
     Response.Redirect("thankyou.htm")
    else
     Response.Redirect("failed.htm")
    end if 
    %> 
    </html>
    This is the important part of the other, working, code:

    Code:
    <% 
    Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
    Mail.FromName   = Request.Form("name")
    Mail.FromAddress= Request.Form("email")
    Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
    Mail.AddRecipient "Redacted" , "Redacted"
    Mail.Subject    = "Online Enquiry"
    Mail.BodyText   = "Name:"
    Mail.BodyText   = Request.Form("name")
    Mail.BodyText   = " "
    Mail.BodyText   = "Email Address:"
    Mail.BodyText   = Request.Form("email")
    Mail.BodyText   = " "
    Mail.BodyText   = "Address:"
    Mail.BodyText   = Request.Form("address")
    Mail.BodyText   = " "
    Mail.BodyText   = "He/She is a:"
    If Request.Form("patient") <> "" Then Mail.BodyText = "Patient"
    If Request.Form("prospatient") <> "" Then Mail.BodyText = "Prospective patient"
    If Request.Form("dentist") <> "" Then Mail.BodyText = "Dentist"
    If Request.Form("other") <> "" Then Mail.BodyText = Request.Form("otherspec")
    Mail.BodyText   = " "
    Mail.BodyText   = "He/She Found out about us from:"
    Mail.BodyText   = Request.Form("hearabout")
    Mail.BodyText   = " "
    Mail.BodyText   = "Enquiry:"
    Mail.BodyText   = Request.Form("enquiry")
    
    if Mail.SendMail then
     Response.Redirect("thankyou.htm")
    else
     Response.Redirect("failed.htm")
    end if 
    %>

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •