Results 1 to 7 of 7

Thread: Dreamweaver submit form script

  1. #1
    Join Date
    Aug 2002
    Posts
    1,097
    Rep Power
    0

    Default Dreamweaver submit form script


    I am working on a website (in dreamweaver) which has a form which request comments from a visitor, and for them to hit the submit button top send the comments to an email address.

    So far it seems like I need a script to complete this task, (correct me if I am wrong) whether java script or cgi or whatever!!

    Does anyone have such a script to share?

  2. #2
    Join Date
    Jul 2002
    Posts
    170
    Rep Power
    0

    Default Re:Dreamweaver submit form script

    Yes you do need a script to do the sending, which is dependent on your server/host - you need to know what your host supports... CDONTS, SENDMAIL, ASPMAIL, W3 JMail, etc. - i'm sure someone will be kind enough to list the ones i have missed ;D



    [glow=red,2,300]FYI[/glow]
    Windows Win2k and XP Pro users - CDOSYS comes installed on Win2k and XP Pro.

    Windows NT4 and Win2k users - IIS 4 and 5 on NT4 and Win2k instals the CDONTS e-mail component by default, but you need the SMTP server that comes with IIS installed on the web server as well (This is the e-mail component that most web hosts will use).

  3. #3
    Join Date
    Aug 2002
    Posts
    1,097
    Rep Power
    0

    Default Re:Dreamweaver submit form script

    Host has ASP support running IIS 5.0 on Windows 2000 and has ASPMail component and DevMailer Component support.



  4. #4
    Join Date
    Jul 2002
    Posts
    170
    Rep Power
    0

    Default Re:Dreamweaver submit form script

    Copy and Paste this code into a new .asp file and then submit your form to it. : >>> Uses CDONTS

    2 Variable are required from the form - Email (email address of sender from form) & the Comments (Comments Field).

    2 other variable exists - your email (destination) and the subject - which i have set to "comments" - Good Luck...

    __________________________________________________ _____

    <%

    Dim strEmailAddress
    Dim strContactEmail
    Dim strComments
    Dim StrSubject

    strEmailAddress = ("rcollin@hotmail.com&quot
    strSubject = ("Comments&quot

    strContactemail = Request.Form("email&quot
    strComments = Request.Form("Comments&quot



    Dim objCDOMail 'Holds the CDONTS mail object

    'Create the e-mail server object (this has to be set with each email for CDONTS)
    Set objCDOMail = Server.CreateObject("CDONTS.NewMail&quot

    With objCDOMail
    'Who the e-mail is from
    .From = strContactemail

    'Who the e-mail is sent to
    .To = strEmailAddress

    'The subject of the e-mail
    .Subject = strSubject

    'The main body of the e-amil
    .Body = "<html><body> " & Comments & "</body><html>"

    'Set the e-mail body format (0=HTML 1=Text)
    If strMailFormat = "HTML" OR strMailFormat = "advHTML" Then
    .BodyFormat = 0
    Else
    .BodyFormat = 1
    End If

    'Set the mail format (0=MIME 1=Text)
    .MailFormat = 0

    'Importance of the e-mail (0=Low, 1=Normal, 2=High)
    .Importance = 1

    'Send the e-mail
    .Send
    End With

    'Release the object (this has to be done with each email for CDONTS)
    Set objCDOMail = Nothing
    Response.Redirect"thanks.htm&quot ;
    %>

    __________________________________________________ ____


    1 more thing - Response.Redirect"thanks.htm" sends you to a page after the processing is completed - you can change the destination page or let the display a message without redirect - its up 2 you...


    BTW: I am terrible at documenting code :-\ so take your time going through it - if it doesn't work catch me online and i'll try to help further... :-x

  5. #5
    Join Date
    Jul 2002
    Posts
    5,446
    Rep Power
    10

    Default Re:Dreamweaver submit form script

    I knew Verm would come through once it was ASP related ;D

  6. #6
    Join Date
    Aug 2002
    Posts
    1,097
    Rep Power
    0

    Default Re:Dreamweaver submit form script

    [quote author=Vermanucci link=board=5;threadid=343;start=0#2463 date=1040352646]

    BTW: I am terrible at documenting code :-\ so take your time going through it - if it doesn't work catch me online and i'll try to help further... :-x

    [/quote]

    Hey Vermanucci,

    Thanks for that, I shall be lookign at it and will let you know how it goes.

    Again Thanks.

  7. #7
    Join Date
    Jul 2002
    Posts
    170
    Rep Power
    0

    Default Re:Dreamweaver submit form script

    [quote author=Chris link=board=5;threadid=343;start=0#2466 date=1040394647]
    I knew Verm would come through once it was ASP related ;D
    [/quote]
    : : :P

Posting Permissions

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