Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

need to send email, some survey check boxes and text comments to both a file & email

Question posted by: jerger (Member) on March 29th, 2008 12:11 AM
I have not made a program or page from start yet. I have made modifications to our signoff asp pages like changing the questions, texts, shortening field lengths etc... I also have copied the files and reused them for other domains

asp 1:
Basically I have a signoff asp script... that asks
a. name b. email address
(then submit)..
this data is written to a sub folder's text file with the same name signoff.txt
if the signoff.asp is bomsignoff.asp the file is created bomsignoff.txt (if it doesn't exist) or it adds it to the bottom line

asp 2:
a different asp page I have asks a question... allowing the user to check some boxes, which flags some answers... they can also add an email address and name... then comment. however all of the choices and answers are sent to an email... to a specific person

asp 3: what I want to create is a program that
part1: takes the name and email, sends them to the text file
part2: take the same name, email and check box answers, comments etc.. and email it to our individual(s)

1. I might make them all on one page
(top of the page have name/email fields... then bottom the questions and check boxes... which would be optional)

2. if the volume was to much.. I would make the survey portion option
-name, email field... then a button to take the optional survey... which grabs the name and email (doesn't need to be retyped)... onto a new asp page where questions followed by comment section boxes or survey check offs are selected... the results are then emailed


end goal:
need to send certain information to the text file... (tab deliminated)
need to send same information and more through an email..

anywhere to start for learning? or any examples? thank you. you guys are the best.

other idea:
how can I pass the name and email address field if asp page one uses a text file... and takes the input and places it there... but then pass it to asp page 2... so i can reuse that information and not make the user retype it... any idea on how to pass variables between pages?
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
DrBunchman's Avatar
DrBunchman
Moderator
555 Posts
March 31st, 2008
12:19 PM
#2

Re: need to send email, some survey check boxes and text comments to both a file & email
Hi Jerger,

To answer a small portion of your question, to pass data between asp pages you can use a couple of different methods.

You are using a form submit on your first page so to retrieve that data on your second page you can use the following example:

Ask the user to input the data on Page 1:
Code: ( text )
  1. <form name="form1" method="post" action="Page2.asp">
  2. <input type="text" name="Username" />
  3. <input type="text" name="email" />
  4. <input type="submit" value="Submit" />
  5. </form>


Retrieve the data on Page 2:
Code: ( text )
  1. <%
  2. Dim sUsername
  3. Dim sEMail
  4.  
  5. sUsername = Request.Form("Username")
  6. sEMail = Request.Form("email")
  7. %>


This is the post method (see the method="post" property in the form tag) and to retreive data from a post you use Request.Form("TheInputName").

There are some further examples on the w3schools site here which will explain the other methods and give you a bit more information.

As for the other parts of your question, here are some examples for sending e-mail and writing to a text file.

Give these a try, let us know how you get on and if you need any more help we'll be glad to give it.

Hope this helps,

Dr B

Reply
Reply
Not the answer you were looking for? Post your question . . .
169,969 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top ASP Forum Contributors