Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Request.Form 'and' cdo.message

Reply
Thread Tools

Request.Form 'and' cdo.message

 
 
whyyyy
Guest
Posts: n/a
 
      05-10-2006
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")






 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      05-10-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
> %>



 
Reply With Quote
 
 
 
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      05-10-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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")
>
>
>
>
>
>



 
Reply With Quote
 
whyyyy
Guest
Posts: n/a
 
      05-10-2006

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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> > %>

>
>
>

 
Reply With Quote
 
whyyyy
Guest
Posts: n/a
 
      05-10-2006
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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")
> >
> >
> >
> >
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments