Request.Form 'and' cdo.message

Discussion in 'ASP General' started by whyyyy, May 10, 2006.

  1. whyyyy

    whyyyy Guest

    USING IIS 5.1, and Windows XP pro, the following form works on my system,
    and I can use as many form elements as I wish, as long as all form elements
    have the same name: "words", in this example.

    Help -- why can`t I give each form element a different name? Any
    suggestions will be gratefully appreciated.

    Also,See example at very bottom of something that once worked on a remote
    server, but doesn't on IIS 5.1, windows xp pro



    <%@LANGUAGE="VBSCRIPT"%>
    <%
    Dim MyMail
    Set MyMail = Server.CreateObject("CDO.Message")
    MyMail.TextBody = Request.Form("words")
    MyMail.From = "postmaster@localhost"
    MyMail.To = "postmaster@localhost"
    MyMail.Subject = "CDOSYS for Windows 2000/XP"
    MyMail.Send()
    Set MyMail = Nothing
    %>

    <HTML>


    <FORM NAME="TextBody" METHOD="post" ACTION="gusto44444444.asp">
    <P><BR>
    <input type="text" NAME= "words" ID="words" COLS="28" ROWS="1">
    Name <br>
    <input type="text" NAME= "words" ID="words" COLS="28" ROWS="1">
    <SPAN CLASS="book_antigua">E-Mail</SPAN><BR CLEAR="all">
    <input type="text" name= "words" id="words" cols="28" rows="1">
    Phone</P>
    <BR>

    <TEXTAREA NAME = "words" ID="words" COLS="18" ROWS="2"
    wrap="VIRTUAL"></TEXTAREA>
    <SPAN CLASS="book_antigua">Write Here </SPAN><BR CLEAR="all">
    <P>
    <INPUT TYPE="submit" NAME="Submit" VALUE="Submit, e-mail required"
    ALIGN="DEFAULT">
    <input type="reset" name="Reset" value="Reset">
    </P>
    <P>
    </P>
    <P>

    </P>
    </FORM>
    <%
    dim words
    words=Request.Form("words")
    If words<>"" Then
    Response.Write("Thanks " & words & "!<br />")
    Response.Write("We'll respond soon")
    End If
    %>




    EXAMPLE AT BOTTOM -- WORKED IN PAST

    BUT NOT NOW

    Dim myMail
    Set myMail = Server.CreateObject("CDONTS.NewMail")

    Request.Form("email1")
    Request.Form("name")
    Request.Form("phone")
    Request.Form("words")
     
    whyyyy, May 10, 2006
    #1
    1. Advertising

  2. You can name your form fields whatever you want, and then access them by
    Request.Form("nameOfInput")

    MyMail.TextBody = Request.Form("input1") & vbCrLf & Request.Form("input2")

    Ray at work

    "whyyyy" <> wrote in message
    news:...
    > USING IIS 5.1, and Windows XP pro, the following form works on my system,
    > and I can use as many form elements as I wish, as long as all form
    > elements
    > have the same name: "words", in this example.
    >
    > Help -- why can`t I give each form element a different name? Any
    > suggestions will be gratefully appreciated.
    >
    > Also,See example at very bottom of something that once worked on a remote
    > server, but doesn't on IIS 5.1, windows xp pro
    >
    >
    >
    > <%@LANGUAGE="VBSCRIPT"%>
    > <%
    > Dim MyMail
    > Set MyMail = Server.CreateObject("CDO.Message")
    > MyMail.TextBody = Request.Form("words")
    > MyMail.From = "postmaster@localhost"
    > MyMail.To = "postmaster@localhost"
    > MyMail.Subject = "CDOSYS for Windows 2000/XP"
    > MyMail.Send()
    > Set MyMail = Nothing
    > %>
     
    Ray Costanzo [MVP], May 10, 2006
    #2
    1. Advertising

  3. You're directly assigning the entire message body, the values of
    request.form("words")

    Why don't you do something like:

    MessageBody = Request.Form("email1") & vbCrLf & _
    Request.Form("name") & vbCrLf & _
    Request.Form("phone") & vbCrLf & _
    Request.Form("words")

    ....

    MyMail.TextBody = MessageBody



    The example you have at the bottom could never have worked. All you do is
    create the object and then type out Request.Form("...")... this should yield
    a type mismatch error or something.




    "whyyyy" <> wrote in message
    news:...
    > USING IIS 5.1, and Windows XP pro, the following form works on my system,
    > and I can use as many form elements as I wish, as long as all form
    > elements
    > have the same name: "words", in this example.
    >
    > Help -- why can`t I give each form element a different name? Any
    > suggestions will be gratefully appreciated.
    >
    > Also,See example at very bottom of something that once worked on a remote
    > server, but doesn't on IIS 5.1, windows xp pro
    >
    >
    >
    > <%@LANGUAGE="VBSCRIPT"%>
    > <%
    > Dim MyMail
    > Set MyMail = Server.CreateObject("CDO.Message")
    > MyMail.TextBody = Request.Form("words")
    > MyMail.From = "postmaster@localhost"
    > MyMail.To = "postmaster@localhost"
    > MyMail.Subject = "CDOSYS for Windows 2000/XP"
    > MyMail.Send()
    > Set MyMail = Nothing
    > %>
    >
    > <HTML>
    >
    >
    > <FORM NAME="TextBody" METHOD="post" ACTION="gusto44444444.asp">
    > <P><BR>
    > <input type="text" NAME= "words" ID="words" COLS="28" ROWS="1">
    > Name <br>
    > <input type="text" NAME= "words" ID="words" COLS="28" ROWS="1">
    > <SPAN CLASS="book_antigua">E-Mail</SPAN><BR CLEAR="all">
    > <input type="text" name= "words" id="words" cols="28" rows="1">
    > Phone</P>
    > <BR>
    >
    > <TEXTAREA NAME = "words" ID="words" COLS="18" ROWS="2"
    > wrap="VIRTUAL"></TEXTAREA>
    > <SPAN CLASS="book_antigua">Write Here </SPAN><BR CLEAR="all">
    > <P>
    > <INPUT TYPE="submit" NAME="Submit" VALUE="Submit, e-mail
    > required"
    > ALIGN="DEFAULT">
    > <input type="reset" name="Reset" value="Reset">
    > </P>
    > <P>
    > </P>
    > <P>
    >
    > </P>
    > </FORM>
    > <%
    > dim words
    > words=Request.Form("words")
    > If words<>"" Then
    > Response.Write("Thanks " & words & "!<br />")
    > Response.Write("We'll respond soon")
    > End If
    > %>
    >
    >
    >
    >
    > EXAMPLE AT BOTTOM -- WORKED IN PAST
    >
    > BUT NOT NOW
    >
    > Dim myMail
    > Set myMail = Server.CreateObject("CDONTS.NewMail")
    >
    > Request.Form("email1")
    > Request.Form("name")
    > Request.Form("phone")
    > Request.Form("words")
    >
    >
    >
    >
    >
    >
     
    Aaron Bertrand [SQL Server MVP], May 10, 2006
    #3
  4. whyyyy

    whyyyy Guest

    Many thanks, Ray

    I`ll let you know how it works

    & vbCrLf something new for me, as is just about everything

    AL





    "Ray Costanzo [MVP]" wrote:

    > You can name your form fields whatever you want, and then access them by
    > Request.Form("nameOfInput")
    >
    > MyMail.TextBody = Request.Form("input1") & vbCrLf & Request.Form("input2")
    >
    > Ray at work
    >
    > "whyyyy" <> wrote in message
    > news:...
    > > USING IIS 5.1, and Windows XP pro, the following form works on my system,
    > > and I can use as many form elements as I wish, as long as all form
    > > elements
    > > have the same name: "words", in this example.
    > >
    > > Help -- why can`t I give each form element a different name? Any
    > > suggestions will be gratefully appreciated.
    > >
    > > Also,See example at very bottom of something that once worked on a remote
    > > server, but doesn't on IIS 5.1, windows xp pro
    > >
    > >
    > >
    > > <%@LANGUAGE="VBSCRIPT"%>
    > > <%
    > > Dim MyMail
    > > Set MyMail = Server.CreateObject("CDO.Message")
    > > MyMail.TextBody = Request.Form("words")
    > > MyMail.From = "postmaster@localhost"
    > > MyMail.To = "postmaster@localhost"
    > > MyMail.Subject = "CDOSYS for Windows 2000/XP"
    > > MyMail.Send()
    > > Set MyMail = Nothing
    > > %>

    >
    >
    >
     
    whyyyy, May 10, 2006
    #4
  5. whyyyy

    whyyyy Guest

    and thanks Aaron

    "Aaron Bertrand [SQL Server MVP]" wrote:

    > You're directly assigning the entire message body, the values of
    > request.form("words")
    >
    > Why don't you do something like:
    >
    > MessageBody = Request.Form("email1") & vbCrLf & _
    > Request.Form("name") & vbCrLf & _
    > Request.Form("phone") & vbCrLf & _
    > Request.Form("words")
    >
    > ....
    >
    > MyMail.TextBody = MessageBody
    >
    >
    >
    > The example you have at the bottom could never have worked. All you do is
    > create the object and then type out Request.Form("...")... this should yield
    > a type mismatch error or something.
    >
    >
    >
    >
    > "whyyyy" <> wrote in message
    > news:...
    > > USING IIS 5.1, and Windows XP pro, the following form works on my system,
    > > and I can use as many form elements as I wish, as long as all form
    > > elements
    > > have the same name: "words", in this example.
    > >
    > > Help -- why can`t I give each form element a different name? Any
    > > suggestions will be gratefully appreciated.
    > >
    > > Also,See example at very bottom of something that once worked on a remote
    > > server, but doesn't on IIS 5.1, windows xp pro
    > >
    > >
    > >
    > > <%@LANGUAGE="VBSCRIPT"%>
    > > <%
    > > Dim MyMail
    > > Set MyMail = Server.CreateObject("CDO.Message")
    > > MyMail.TextBody = Request.Form("words")
    > > MyMail.From = "postmaster@localhost"
    > > MyMail.To = "postmaster@localhost"
    > > MyMail.Subject = "CDOSYS for Windows 2000/XP"
    > > MyMail.Send()
    > > Set MyMail = Nothing
    > > %>
    > >
    > > <HTML>
    > >
    > >
    > > <FORM NAME="TextBody" METHOD="post" ACTION="gusto44444444.asp">
    > > <P><BR>
    > > <input type="text" NAME= "words" ID="words" COLS="28" ROWS="1">
    > > Name <br>
    > > <input type="text" NAME= "words" ID="words" COLS="28" ROWS="1">
    > > <SPAN CLASS="book_antigua">E-Mail</SPAN><BR CLEAR="all">
    > > <input type="text" name= "words" id="words" cols="28" rows="1">
    > > Phone</P>
    > > <BR>
    > >
    > > <TEXTAREA NAME = "words" ID="words" COLS="18" ROWS="2"
    > > wrap="VIRTUAL"></TEXTAREA>
    > > <SPAN CLASS="book_antigua">Write Here </SPAN><BR CLEAR="all">
    > > <P>
    > > <INPUT TYPE="submit" NAME="Submit" VALUE="Submit, e-mail
    > > required"
    > > ALIGN="DEFAULT">
    > > <input type="reset" name="Reset" value="Reset">
    > > </P>
    > > <P>
    > > </P>
    > > <P>
    > >
    > > </P>
    > > </FORM>
    > > <%
    > > dim words
    > > words=Request.Form("words")
    > > If words<>"" Then
    > > Response.Write("Thanks " & words & "!<br />")
    > > Response.Write("We'll respond soon")
    > > End If
    > > %>
    > >
    > >
    > >
    > >
    > > EXAMPLE AT BOTTOM -- WORKED IN PAST
    > >
    > > BUT NOT NOW
    > >
    > > Dim myMail
    > > Set myMail = Server.CreateObject("CDONTS.NewMail")
    > >
    > > Request.Form("email1")
    > > Request.Form("name")
    > > Request.Form("phone")
    > > Request.Form("words")
    > >
    > >
    > >
    > >
    > >
    > >

    >
    >
    >
     
    whyyyy, May 10, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    897
    dave wanta
    Jul 11, 2003
  2. =?Utf-8?B?TWljaGFlbA==?=
    Replies:
    1
    Views:
    2,805
    Andy Miller
    Jul 24, 2004
  3. Emmett Power
    Replies:
    0
    Views:
    603
    Emmett Power
    Sep 24, 2004
  4. whyyyy
    Replies:
    3
    Views:
    198
  5. Replies:
    0
    Views:
    288
Loading...

Share This Page