I've gotten myself into a bigger asp
VB coding project than I imagined and I need some help understanding some basics...
What I'm doing is pretty simple -
From a flash widget form with only 3 inputs, I need to do 3 things in ASP:
(1) send an email to me with 3 inputs
(2) send a confirmation email to the User
(3) append the User's Email to a text file (to be loaded into flash later in order to verify a unique email address)
I have working code for the emails, and working code to write to a text file - but I can't merge them into one asp document, I think, because I don't understand how to use the System.IO Namespace.
Here's where I'm having issues:
To write to a text file requires Importing the System.IO namespace, but when I Import that in the same ASP file as my email processing script I start getting a lot of errors in the email script. It seems like the System.IO namespace causes ASP to interpret my code differently. The errors tell me to add Parens where I didn't need them before etc.
So, Is there a way to Isolate the imported Namespace so that it only applies to a select chunk of code instead of the entire page?
Or am I understanding this incorrectly.
Here's my code for writing a text file that I am having trouble merging into another asp document:
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
<% @ LANGUAGE="VBSCRIPT" CODEPAGE="1252" %>
<%@ Import Namespace="System.IO" %>
<%
'sending emails happens here
' ...if Mail.SendMail then
Dim recemails As String
recemails = Request.Form("emailaddress")
Dim fp As StreamWriter
Dim myemails = recemails
Try
fp = File.CreateText(Server.MapPath("../text/") & "emails.txt")
fp.WriteLine(myemails)
fp.Close()
Catch err As Exception
Finally
End Try
Response.Write ("received emails= " & recemails)
Response.Write ("myemails= " & myemails)
%>
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
Thanks - Any help is greatly appreciated.