2 Programs



These two programs are a "must have" when your creating a new web site. Place the first program in the folder were you're creating the new site and the second one in your wwwroot folder. (see: IIS and the wwwroot folder)

~Run.html

Replace Your_Folder_Name  with the name of the Folder you're working in and you can now double click ~Run.html and your default.asp page will run on your localhost. I usually copy this program into the new folder were I'm working on a new project so I can quickly get back to editing the project. Copy and paste this code into a text file named ~Run.html. The ~ (tilde) in front of Run is not important it just makes this file easy to find in the folder.
<html>
<head>
  <title> ~Run Program </title>
  <meta http-equiv='refresh' content='0;url= http://localhost/Your_Folder_Name/default.asp'>
</head>
<body>
</body>
</html>
Echo.asp

This ASP program will allow you to see the Field Names and values from your HTML form. Simply set the action attribute to: action='http://localhost/Echo.asp' and when you click the submit button this page will pop-up with your form data. Copy and paste this code into a text file named Echo.asp in the wwwroot folder on you computer.
<html>
<head>
  <title> Echo Program </title>
</head>
<body bgcolor='darkseagreen'>

<%
Dim Item
For Each Item in Request.Form
  Response.Write Item & " = "
  Response.Write Request(Item) & "<br>"
Next
%>

<br><br>
<input type='button' value='Return' onClick='history.back();'>
</body>
</html>
EchoEmail.asp

This ASP program will allow you to Email the Field Names and values from your HTML form.
<!-- * * * * * * * * * * -->
<!-- * EchoEmail.asp  * -->
<!-- * * * * * * * * * * -->
<html>
<head>
  <title> Echo Email Program </title>
</head>
<body bgcolor='darkseagreen'>

<%
' * * * * * * * * * * *
' * Collect Form Data *
' * * * * * * * * * * *
Dim eText, Item
eText = ""
For Each Item in Request.Form
    eText = eText & Item & " = " & Request(Item) & "<br>"
Next

' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * You MUST Enter the following information for the e-mailer to work *
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Dim sName, fMail, fName, tMail, tName, Title

sName = "your-outgoing-email-server-name-here" '(if you do not know, ask you Interset server provider)

fMail = "enter-the-from-email (person sending the e-mail)"
fName = "enter-the-from-name"

' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * NOTE: You may include the fMail & fName in your form like this: *
' * Enter Your Email Address here: <input type='text' name='fMail'> *
' * Your First Name and Last Name: <input type='text' name='fName'> *
' * Collect the fMail & fName information from your form like this: *
' * Change fMail="enter-the-from-email" to fMail = Request("fMail") *
' * Change fName="enter-the-from-name" to  fName = Request("fName") *
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

tMail = "enter-the-to-email-address-here (person to receive the e-mail)"
tName = "enter-the-to-name-here"
Title = "your-email-title-here"

' * * * * * * * * * *
' * Email Form Data *
' * * * * * * * * * *
Dim sch, cdoConfig, Mailer
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
  .Item(sch & "sendusing") = 2
  .Item(sch & "smtpserver") = sName
  .update
End With
Set Mailer = CreateObject("CDO.Message")
Set Mailer.Configuration = cdoConfig
Mailer.From = fMail & " (" & fName & ")"
Mailer.To = tEmail & " (" & tName & ")"
Mailer.Subject = Title
Mailer.HTMLBody = "<h3>" & Title & "</h3>" & eText
Mailer.Send
Set Mailer = nothing
%>

<!-- * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * Place your Thank You notice below here  * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * -->
Thank You!<br>
Your e-mail to <%=tName%> has been sent.
<br><br>

<input type='button' value='Return' onClick='history.back();'>
</body>
</html>