I am trying to receive an input for an e-mail address from a textbox in one .asp file called order.asp and then e-mail to that e-mail address using code in another .asp file called ordercomplete.asp (which uses CDO mail). The mailer works correctly if i specifically define ObjSendMail.To = someemail@provider.com, but not if i use a session variable such that ObjSendMail.To = Session("EmailSession") so that it's more dynamic. This is order.asp
<form id="form1" name="form1" method="post" action="ordercomplete.asp">
<p>
<label for="firstname">First Name:</label>
<input type="text" name="firstname" id="firstname" />
<%
Session("EmailSession") = Request.Form("email")
%>
</p>
<p>
<label for="email">E-Mail Address:</label>
<input type="text" name="email" id="email" />
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit" />
</p>
</form>
<p> </p>
In ordercomplete.asp, I tried to see if I can print the value that's been inputted in the email textbox in order.asp before I can go ahead and set ObjSentMail.To to the session variable. I tried to print and see if there is anything saved in Session("EmailSession")) at all using
<%
Response.Write(Session("EmailSession"))
%>
but it prints nothing. How can I get an inputted value from one asp file to transfer in this manner in another asp file?
Thanks.