Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

get.asp form thankyou email

Options
  • 30-03-2005 10:54am
    #1
    Registered Users Posts: 1,218 ✭✭✭


    I want to create a form, that when submitted, sends an email to the person who filled it out, by sending it to the email address they filled in.

    does anyone know what asp code I have to add to make this functional? :rolleyes:

    This is my code so far:
    <%
    Dim requirednamename,requiredname,t2name,t2,requiredmobilename,requiredmobile,t4name,t4,t5name,t5,t6name,t6,t7name,t7,t8name,t8
    requirednamename = "Name"
    requiredname = Request.Form("requiredname")
    t2name = "Email"
    t2 = Request.Form("t2")
    requiredmobilename = "Mobile Number"
    requiredmobile = Request.Form("requiredmobile")
    t4name = "Other Number"
    t4 = Request.Form("t4")
    t5name = "Spain Area"
    t5 = Request.Form("t5")
    t6name = "Portugal Area"
    t6 = Request.Form("t6")
    t7name = "No. of Bedrooms"
    t7 = Request.Form("t7")
    t8name = "When do you plan to buy?"
    t8 = Request.Form("t8")
    Dim requiredaddressname,requiredaddress,st2name,st2,st3name,st3
    requiredaddressname = "Address" 
    requiredaddress = Request.Form("requiredaddress")
    st2name = "Requirement for Mortgage" 
    st2 = Request.Form("st2")
    st3name = "Other Comments" 
    st3 = Request.Form("st3")
    Dim dr1name,dr1,dr2name,dr2,dr3name,dr3,dr4name,dr4,dr5name,dr5,dr6name,dr6,dr7name,dr7
    dr1name = "Type of property" 
    dr1 = Request.Form("dr1")
    dr2name = "Location" 
    dr2 = Request.Form("dr2")
    dr3name = "Purpose" 
    dr3 = Request.Form("dr3")
    dr4name = "If for own use, do you have small children?" 
    dr4 = Request.Form("dr4")
    dr5name = "Condition" 
    dr5 = Request.Form("dr5")
    dr6name = "Interested in Spanish Properties" 
    dr6 = Request.Form("dr6")
    dr7name = "Interested in Portuguese Properties" 
    dr7 = Request.Form("dr7")
    Dim ObjMail
    Set ObjMail = Server.CreateObject("CDONTS.NewMail")
    ObjMail.To = "*******blanked out for privacy********"
    ObjMail.From = "Website_Form"
    ObjMail.Subject = "Property_Enquiry"
    ObjMail.Body = requirednamename & vbcrlf&_
    requiredname & vbcrlf&_
    requiredaddressname & vbcrlf&_
    requiredaddress & vbcrlf&_
    t2name & vbcrlf&_
    t2 & vbcrlf&_
    requiredmobilename & vbcrlf&_
    requiredmobile & vbcrlf&_
    t4name & vbcrlf&_
    t4 & vbcrlf&_
    dr6name & vbcrlf&_
    dr6 & vbcrlf&_
    t5name & vbcrlf&_
    t5 & vbcrlf&_
    dr7name & vbcrlf&_
    dr7 & vbcrlf&_
    t6name & vbcrlf&_
    t6 & vbcrlf&_
    dr1name & vbcrlf&_
    dr1 & vbcrlf&_
    t7name & vbcrlf&_
    t7 & vbcrlf&_
    dr2name & vbcrlf&_
    dr2 & vbcrlf&_
    dr3name & vbcrlf&_
    dr3 & vbcrlf&_
    dr4name & vbcrlf&_
    dr4 & vbcrlf&_
    dr5name & vbcrlf&_
    dr5 & vbcrlf&_
    t8name & vbcrlf&_
    t8 & vbcrlf&_
    st2name & vbcrlf&_
    st2 & vbcrlf&_
    st3name & vbcrlf&_
    st3
    ObjMail.Send
    Set ObjMail = Nothing
    'HERE you make a choice. You can redirect the user to any page in your site
    Response.Redirect "ContactUs_thankyou.html"
    'Or just say thanks. Delete the line you dont want. Either above or below
    Response.Write"Thank You"
    %>
    


    all advice appreciated ;)


Comments

  • Registered Users Posts: 7,739 ✭✭✭mneylon


    Have you looked at what other people have done?
    There's a load of these kind of scripts on Hotscripts


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    There is an excellent one which will need a slight tweak available from www.brainjar.com. Supports multiple email components also


  • Closed Accounts Posts: 939 ✭✭✭chicken_food


    Apart from the obvious "you're using ASP,...idiot." reply, I've had trouble before when the server the asp is running on doesn't have it's (own) mail server configured correctly. Consequently, it does nothing, and may not give an error back at all as the email component mightn't check for corrent config.

    This has been my most common problem with email scripts, components, etc. etc. for ASP, Php, Coldfusion etc. etc.

    Mightn't be the problem in your case, but hopefully this helps someone.


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    @chicken_food - why is one an idiot for using ASP?
    Furthermore, I have designed a lot of sites using ASP and never once found the mail server incorrectly configured - it may happen but it is extremely unlikely.
    The OP is trying to send a mail using CDONTS. The mail server may simply not use this in favour of CDOSYS or JMail or ASPEmail or...


  • Registered Users Posts: 706 ✭✭✭DJB


    Have a look at this script... it's a form to mail script I wrote a while back. You can easily manipulate it to do what you want...

    http://www.dynamic.ie/sourcecode/formtomail.asp

    Rgds,

    Dave


  • Advertisement
  • Registered Users Posts: 1,218 ✭✭✭davidclayton


    thanx for everyone's help and suggestions,
    i have sorted this problem :)


Advertisement