Formmail works only partially?

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

  1. #1

    Default Formmail works only partially?

    I have 2 different forms in my site using formmail to send it to my email. One
    page sends and redirects successfully, only none of the info in text boxes is
    submitted. I have another formmail that redirects successfully but never makes
    it to my email at all. I've included the script for the one that works
    partially. The other is exactly the same but with different questions. Any
    ideas on the problem?



    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/Clients.asp" -->
    <%
    ' *** Restrict Access To Page: Grant or deny access to this page
    MM_authorizedUsers=""
    MM_authFailedURL="not_authorized.asp"
    MM_grantAccess=false
    If Session("MM_Username") <> "" Then
    If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
    (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
    MM_grantAccess = true
    End If
    End If
    If Not MM_grantAccess Then
    MM_qsChar = "?"
    If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
    MM_referrer = Request.ServerVariables("URL")
    if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" &
    Request.QueryString()
    MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
    Server.URLEncode(MM_referrer)
    Response.Redirect(MM_authFailedURL)
    End If
    %>
    <%
    Dim Recordset1__MMColParam
    Recordset1__MMColParam = "1"
    If (Session("MM_username") <> "") Then
    Recordset1__MMColParam = Session("MM_username")
    End If
    %>
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_Clients_STRING
    Recordset1.Source = "SELECT * FROM clients WHERE username = '" +
    Replace(Recordset1__MMColParam, "'", "''") + "'"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library" -->
    <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
    NAME="ADODB Type Library" -->
    <%
    Response.Buffer = true
    Session.Abandon()

    if Request.ServerVariables("REQUEST_METHOD") = "POST" then ' user is
    sending a cancellation

    ' create the e-mail object and set the various fields
    Set objMessage = Server.CreateObject("CDO.Message")
    objMessage.To = "removed@test.com"
    objMessage.From = "Innovation Lab Website"
    objMessage.ReplyTo = Recordset1.Fields.Item("email")
    objMessage.Sender = "removed@test.com"
    objMessage.Subject = "Cancel a Reservation"
    BodyText = BodyText & "<p>Cancel the following:.</p>"
    BodyText = BodyText & "<table>"
    BodyText = BodyText & "<tr><td
    align=right>Name:</td><td>"&Recordset1.Fields.Item("full").Value&"</td></tr>"
    BodyText = BodyText & "<tr><td align=right>Company:</td><td>"
    &Recordset1.Fields.Item("company").Value&"</td></tr>"
    BodyText = BodyText & "<tr><td align=right>Email:</td><td>"
    &Recordset1.Fields.Item("email").Value&"</td></tr>"
    BodyText = BodyText & "<tr><td align=right>Room:</td><td>"
    &Request.Form("room")&"</td></tr>"
    BodyText = BodyText & "<tr><td align=right>Date:</td><td>"
    &Request.Form("dte")&"</td></tr>"
    BodyText = BodyText & "<tr><td align=right>Time:</td><td>"
    &Request.Form("tme")&"</td></tr>"
    BodyText = BodyText & "</table>"
    objMessage.HTMLBody = BodyText

    ' specify mail server information
    set objConfig = Server.CreateObject("CDO.Configuration")
    objConfig.Fields(cdoSendUsingMethod) = 2
    objConfig.Fields(cdoSMTPServer) = "removed.email.com"
    objConfig.Fields(cdoSMTPServerPort) = 25
    objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
    objConfig.Fields.Update
    set objMessage.Configuration = objConfig

    ' send the message and dispose of the object
    objMessage.Send()
    set objConfig = Nothing
    set objMessage = Nothing
    Server.Transfer ("cancellation_thank_you.htm")
    'else visitor is going to view the cancellation page
    Server.Transfer ("index.htm")
    end if

    %>
    <%
    Recordset1.Close()
    Set Recordset1 = Nothing
    %>

    innovationlab Guest

  2. Similar Questions and Discussions

    1. FormMail help needed
      I'm stuck. I read a bunch of entries on this forum, but still stuck. I'm not sure how to retrieve the form results from my webpage. I realize the...
    2. formmail.cgi problem
      Hi, I have found a cgi-script to send the result of a form to my e-mail address. But it doesn't work. I know nothing about cgi scripts. I hope...
    3. FormMail
      I need an example of form mail, can you send me the source (*.fla)? Thanks -- m@urich :oD
    4. [php] formmail.pl formmail.php
      Not that formmail.pl was the most secure idea, but it could take any variable off any form and mail the contents to a vriable on that form. Does...
    5. USB works partially
      -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hallo! USB support is working because I'm using both a ps2 and a usb mouse (HP Omnibook XT1000...
  3. #2

    Default Re: Formmail works only partially?

    Hi,

    I noticed you are using "+" to concatenate strings at some places. This
    is Javascript, not VBScript. Be careful, this can lead to very weird
    results (I had the case myself in a not-so-careful conversion from JS to
    VB...). As it is on the SELECT of your main recordset, I'd be careful.
    Have you checked if your SELECT is successful ? Of course, if it isn't
    then no e-mail would ever be created, and you'd got an error, because
    you are not trapping EOF.

    Regards
    Bernard

    innovationlab wrote:
    > I have 2 different forms in my site using formmail to send it to my email. One
    > page sends and redirects successfully, only none of the info in text boxes is
    > submitted. I have another formmail that redirects successfully but never makes
    > it to my email at all. I've included the script for the one that works
    > partially. The other is exactly the same but with different questions. Any
    > ideas on the problem?
    >
    >
    >
    > <%@LANGUAGE="VBSCRIPT"%>
    > <!--#include file="Connections/Clients.asp" -->
    > <%
    > ' *** Restrict Access To Page: Grant or deny access to this page
    > MM_authorizedUsers=""
    > MM_authFailedURL="not_authorized.asp"
    > MM_grantAccess=false
    > If Session("MM_Username") <> "" Then
    > If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
    > (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
    > MM_grantAccess = true
    > End If
    > End If
    > If Not MM_grantAccess Then
    > MM_qsChar = "?"
    > If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
    > MM_referrer = Request.ServerVariables("URL")
    > if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" &
    > Request.QueryString()
    > MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
    > Server.URLEncode(MM_referrer)
    > Response.Redirect(MM_authFailedURL)
    > End If
    > %>
    > <%
    > Dim Recordset1__MMColParam
    > Recordset1__MMColParam = "1"
    > If (Session("MM_username") <> "") Then
    > Recordset1__MMColParam = Session("MM_username")
    > End If
    > %>
    > <%
    > Dim Recordset1
    > Dim Recordset1_numRows
    >
    > Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    > Recordset1.ActiveConnection = MM_Clients_STRING
    > Recordset1.Source = "SELECT * FROM clients WHERE username = '" +
    > Replace(Recordset1__MMColParam, "'", "''") + "'"
    > Recordset1.CursorType = 0
    > Recordset1.CursorLocation = 2
    > Recordset1.LockType = 1
    > Recordset1.Open()
    >
    > Recordset1_numRows = 0
    > %>
    > <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    > NAME="CDO for Windows 2000 Library" -->
    > <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
    > NAME="ADODB Type Library" -->
    > <%
    > Response.Buffer = true
    > Session.Abandon()
    >
    > if Request.ServerVariables("REQUEST_METHOD") = "POST" then ' user is
    > sending a cancellation
    >
    > ' create the e-mail object and set the various fields
    > Set objMessage = Server.CreateObject("CDO.Message")
    > objMessage.To = "removed@test.com"
    > objMessage.From = "Innovation Lab Website"
    > objMessage.ReplyTo = Recordset1.Fields.Item("email")
    > objMessage.Sender = "removed@test.com"
    > objMessage.Subject = "Cancel a Reservation"
    > BodyText = BodyText & "<p>Cancel the following:.</p>"
    > BodyText = BodyText & "<table>"
    > BodyText = BodyText & "<tr><td
    > align=right>Name:</td><td>"&Recordset1.Fields.Item("full").Value&"</td></tr>"
    > BodyText = BodyText & "<tr><td align=right>Company:</td><td>"
    > &Recordset1.Fields.Item("company").Value&"</td></tr>"
    > BodyText = BodyText & "<tr><td align=right>Email:</td><td>"
    > &Recordset1.Fields.Item("email").Value&"</td></tr>"
    > BodyText = BodyText & "<tr><td align=right>Room:</td><td>"
    > &Request.Form("room")&"</td></tr>"
    > BodyText = BodyText & "<tr><td align=right>Date:</td><td>"
    > &Request.Form("dte")&"</td></tr>"
    > BodyText = BodyText & "<tr><td align=right>Time:</td><td>"
    > &Request.Form("tme")&"</td></tr>"
    > BodyText = BodyText & "</table>"
    > objMessage.HTMLBody = BodyText
    >
    > ' specify mail server information
    > set objConfig = Server.CreateObject("CDO.Configuration")
    > objConfig.Fields(cdoSendUsingMethod) = 2
    > objConfig.Fields(cdoSMTPServer) = "removed.email.com"
    > objConfig.Fields(cdoSMTPServerPort) = 25
    > objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
    > objConfig.Fields.Update
    > set objMessage.Configuration = objConfig
    >
    > ' send the message and dispose of the object
    > objMessage.Send()
    > set objConfig = Nothing
    > set objMessage = Nothing
    > Server.Transfer ("cancellation_thank_you.htm")
    > 'else visitor is going to view the cancellation page
    > Server.Transfer ("index.htm")
    > end if
    >
    > %>
    > <%
    > Recordset1.Close()
    > Set Recordset1 = Nothing
    > %>
    >
    bthouin 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