Thread: contact form

    #1
  1. No Profile Picture
    hitokiri battousai
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    38
    Rep Power
    12

    contact form


    how would I go about creating some sort of contact page on my website instead of having people using my email address directly?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Arlington, VA
    Posts
    191
    Rep Power
    11
    And why is this post on Business section? Anyway - creating some sort of contact page - that is very vague. What are you using, plain HTML on unix server? .NET on IIS? Coldfusion? J2EE? What exactly are you using?
  4. #3
  5. Type Cast Exception
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    OAKLAND CA | Adam's Point (Fairyland)
    Posts
    14,954
    Rep Power
    8617
    I don't know how you would go about it. I'd write a Perl script, it would take about five minutes, and I'd be done with it.

    You can Google for Perl you can Google for PHP but either way there's probably only a few million examples to be found.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    20
    Rep Power
    0
    If you have asp and Cdonts support, you can just use the script below. Copy and paste and change the email to your own and change the redirect URL. I'm assuming that you can create your html form with the method = post and action = to the script file name (mines is send_email.asp). If you have any problems with it, let me know.

    send_email.asp file starts here
    ----------------------------------------------------
    <%
    Option Explicit

    Dim objNewMail, userName, userEmail, userComment

    userName = Request.Form("userName")
    userEmail = Request.Form("userEmail")
    userComment = Request.Form("userComment")

    ' First create an instance of NewMail Object
    Set objNewMail = Server.CreateObject("CDONTS.NewMail")

    ' For objNewMail.From, you can use the one received from
    ' the form, userEmail, but if the user types in an invalid email
    ' you will not receive the email.
    ' So I just placed the user email in the subject of
    ' the email. Of course you could do a
    ' validation check but this is the simple way

    objNewMail.From = "your_userid@your_domain.com"
    objNewMail.To = "your_userid@your_domain.com"

    objNewMail.Subject = "Any subject title you want"
    objNewMail.Body = "Name: " & userName & " *** Email: " & userEmail & " *** Comments: " & userComment
    objNewMail.Send

    ' After the Send method, the NewMail Object become Invalid
    ' You should set it to nothing to relase the memory

    Set objNewMail = Nothing

    ' If you want to send another mail
    ' you have to create a new instance of NewMail Object again.

    Response.Redirect "http://www.some-confirmation-page-or-any-other-page.html"
    %>

    --- end of script
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    20
    Rep Power
    0
    ASP and CDonts are much simpler than Perl and CGI.
  10. #6
  11. No Profile Picture
    tony
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2004
    Location
    manchester uk
    Posts
    672
    Rep Power
    11
    if your server doesnt accept asp then id try hotscripts.com they will have a ready made script where you just have to make 1 or 2 changes, or if you send me a PM ill send you the files needed to create 1 like on my site

IMN logo majestic logo threadwatch logo seochat tools logo