Need help with Email Form

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Need help with Email Form

    Hello,

    I've been working through a tutorial on Form Handling. I'm trying to learn
    how to make a simple Contact Us for with Name, email address, subject and
    message. I've gone through part of the tutorial and thought I better test it.
    I'm working on a pc in DreamweaverMX 2004. I went to test it out in Internet
    Explorer and I get a compilation error: ?

    'Let' and 'Set' assignment statements are no longer supported.

    ? and it points to the line?

    Set objCDO=Server.CreateObject("CDONTS.NewMail")

    I am new to this I don't know where to look to get the new terminology. When
    I search the web, all examples are using the 'Set' assignment??

    If you could help I'd greatly appreciate it.

    Thanks,
    Skeeter

    <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    <%
    if Request.Querystring("isSubmitted") = "yes" then

    Dim yname, emailVar, tsubject, tMessage
    Dim objCDO

    yname = Request.QueryString("Name")
    emailVar = Request.QueryString("Email_Address")
    tsubject = Request.QueryString("Subject")
    tMessage = Request.QueryString("Message")

    'this is where code is inserted to invoke DCONTS

    'This line invoked the object using the name objCDO
    Set objCDO=Server.CreateObject("CDONTS.NewMail")

    objCDO.From = emailVar
    objCDO.To = "email@usa.com"
    'to cc someone
    'objCDO.CC = "emailaddress@email.com"
    'to blind copy someone
    'objCDO.Bcc = "emailaddress@email.com"
    objCDO.Subject = "Subject: " & tsubject
    objCDO.Body = "Name: " & yname & "email?Address: " & emailVar & "Message: " &
    tMessage

    'BodyFormat=1 for text format, BodyFormat=0 for html format
    objCDO.BodyFormat=1
    objCDO.MailFormat=1

    objCDO.Send

    ConfirmMsg = "Thanks for submitting you comments."

    end if
    %>

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Contact Us</title>
    </head>
    <body>
    <% if ConfirmMsg<>"" then %>
    <h2><%=ConfirmMsg %></h2>
    <% end if %>

    <form action="../formtest.asp" method="get" enctype="text/plain"
    name="input_form" id="input_form">
    <table width="700" border="0" cellspacing="10" cellpadding="0">
    <tr>
    <td>Name </td>
    <td><input name="yname" type="text" id="yname" size="30"
    maxlength="50"></td><br>
    </tr>
    <tr>
    <td>Email Address </td>
    <td><input name="Email_Address" type="text" size="30"
    maxlength="50"></td>
    </tr>
    <tr>
    <td>subject</td>
    <td><input name="tsubject" type="text" id="tsubject" size="50"
    maxlength="80"></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><textarea name="tMessage" cols="50" rows="10"
    id="tMessage"></textarea></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input name="isSubmitted" type="hidden" value="yes"></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="Submit" value="Submit"></td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    amelunks Guest

  2. Similar Questions and Discussions

    1. email form
      Hi people Can anyone tell me why my email form will work fine when I preview it seperatly but not when embedded within my site, I mean check out...
    2. PES Email Form
      Does anyone know what's happened to Gregory Peacock? I need to get hold of the PES Email Form - I've stupidly lost my copy of it and I went back to...
    3. Connenting email form to an email account
      :( I am at a mental brickwall. I created a form, created two text fields and a "log in" button. What I want to have happen is when a person goes to...
    4. Form without Email
      I trying to make a form without using the email from the sender, what i need is a script that send the form directly to my email without using the...
    5. Email a form
      I am trying to email information that users enter on my website using a submit button. However, it is not working. Is there a simple way to do...
  3. #2

    Default Re: Need help with Email Form

    Sounds like you're mixing up ASP and ASP.NET. You've got VB Script in an
    ASPX page. Create an ASP page and put your script in there.

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139