Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request.QueryString & AspEmail

Status
Not open for further replies.

BusinessDesign

Programmer
Jan 29, 2002
3
US
Hi,

I am new to the list and new to ASP. I have listed my code below. The problem is that the Bid ID value does not appear in the email.

I know that the Request.QueryString("BidID") works because the Response.Redirect at the bottom of the code works.

I would appreciate any help.

<%
Dim bidid, name, company

bidid = Request.QueryString(&quot;BidID&quot;)
name = Request.Form(&quot;Name&quot;)
company = Request.Form(&quot;Company&quot;)

Set Mail = Server.CreateObject(&quot;Persits.MailSender&quot;)
Mail.Host = &quot;mymailserver&quot; ' Specify a valid SMTP server
Mail.From = &quot;online@mysite.org&quot; ' Specify sender's address
Mail.FromName = &quot;My Website&quot; ' Specify sender's name
Mail.AddAddress &quot;purchasing@mysite.org&quot;

Mail.Subject = &quot;Bid Packet Download&quot;
Mail.Body = &quot;Bid ID: &quot; & BidID & &quot;&quot; & Chr(13) & Chr(10) & _
&quot;Name: &quot; & Name & &quot;&quot; & Chr(13) & Chr(10) & _
&quot;Company: &quot; & Company & &quot;&quot; & Chr(13) & Chr(10)

On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write &quot;Error encountered: &quot; & Err.Description
End If
%>
<%Response.redirect &quot;/main/mgmt_serv/purchasing/bid_pkts/&quot; & Request.QueryString(&quot;BidID&quot;) & &quot;.htm&quot; %>

Thank you in advance,
Michelle
 
after
bidid = Request.QueryString(&quot;BidID&quot;)
do
response.write &quot;bidid = &quot; & bidid & &quot;<br>&quot;
response.end

to see if the value is making it into the variable....
 
Yes, the variable is there. Someone suggested that I change bidid=Request.QueryString(&quot;BidID)to bidid=Request.Form(&quot;BidID&quot;).

Here is the complete scenerio using FrontPage:

Page1 passes the Bid ID value to Page2 as page2.asp?BidID=<%=FP_FieldVal(fp_rs,&quot;Bid_ID&quot;)%>

Page2 (which is a form without the form field Bid ID) posts the Bid ID value to Page3 as page3.asp?<%=Request.QueryString%>

Page3 is the AspEmail code.

I think I need to make Bid ID a hidden form field on Page2. But how do I pass a hidden field to Page3?

Hope this makes sense. Thanks, Michelle

 
in the form in page2, add your hidden form field:

<input type=&quot;hidden&quot; name=&quot;BidID&quot; value=&quot;<%=Request.QueryString(&quot;BidID&quot;)%>&quot;>


then you can access BidID just as you do your other form fields on page3 -

BidID = Request.Form(&quot;BidID&quot;)

And it could be that as you have it now, it passes BidID to page2 (in the querystring as you have it), but it's not getting forwarded to page3 where the email is sent. adding the hidden form field and accessing it like above will solve that problem for you though.

Good luck!
 
Thank you so much. This makes sense to me.

Much appreciation,

Michelle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top