Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 7th, 2005, 05:36 PM
bears13 bears13 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 21 bears13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 22 m
Reputation Power: 0
Email?

Code:
<%
Response.CacheControl = "Private"
Response.Expires = 0
 
'===================================
'Dimensiion varaibles and constants
'===================================
Dim strFirstName, strLastName
Dim strSocialSecurityNumber
Dim strDateOfBirth
Dim strHomePhone
Dim strEmailAddress
Dim strStartYear
Dim strStartTerm
Dim strGraduationMonth
 
'=================================================  =
'RETRIEVE VALUES FROM FORM AND STORE IN VARIABLES
'=================================================  =
strFirstName = Request.Form("txtFirstName")
strLastName = Request.Form("txtLastName")
strSocialSecurityNumber = Request.Form("txtSocialSecurityNumber")
strDateOfBirth = Request.Form("txtDateOfBirth")
strHomePhone = Request.Form("txtHomePhone")
 
strEmailAddress = Request.Form("txtEmailAddress")
strStartYear = Request.Form("optStartYear")
strStartTerm = Request.Form("optStartTerm")
strGraduationMonth = Request.Form("radGraduationMonth")
 
 
 
Sub DisplayFormValues()
Call WriteTableHeader()
Call WriteTableBody()
Call WriteTableFooter()
End Sub 'DisplayFormValues
 
Sub WriteTableHeader()
Dim strBuffer
 
strBuffer = "<table border='1' cellpadding='3' cellspacing='0' width='580'>"
 
Response.Write strBuffer
 
End Sub 'WriteTableHeader()
 
Sub WriteTableBody()
Call WriteStudentInformation()
Call WriteCollegePlans()
End Sub
 
Sub WriteTableFooter()
Dim strBuffer
 
strBuffer = "</table>"
 
Response.Write strBuffer
End Sub
 
'=================================================  =====
'SectionHeader for Student Data
'=================================================  =====
 
Sub WriteStudentInformation()
Dim strField, strValue
 
Call WriteSectionHeader ("Student Data")
 
strField = "Student's Name:"
strValue = strFirstName & " " & strLastName
WriteRow strField, strValue 
 
strField = "Social Security Number:"
strValue = strSocialSecurityNumber
WriteRow strField, strValue
 
strField = "Date Of Birth:"
strValue = strDateOfBirth
WriteRow strField, strValue
 
strField = "Home Phone:"
strValue = strHomePhone
WriteRow strField, strValue
 
strField = "Email Address:"
strValue = strEmailAddress
WriteRow strField, strValue
 
 
End Sub
 
'=================================================  =====
'SectionHeader for College Plans
'=================================================  =====
 
Sub WriteCollegePlans()
Dim strField, strValue
 
Call WriteSectionHeader ("College Plans")
 
strField = "Start Year:"
strValue = strStartYear
WriteRow strField, strValue
 
strField = "Start Term:"
strValue = strStartTerm
WriteRow strField, strValue
 
strField = "Expected Graduation Month:"
strValue = strGraduationMonth
WriteRow strField, strValue
End sub
 
'=================================================  =====
'Table setup to find values for SectionHeaders
'=================================================  =====
 
Sub WriteSectionHeader(strSectionName)
Dim strBuffer
 
strBuffer = "<tr>" & _
"<td colspan='2' bgcolor='#eee8aa'><b><font size='3' face='Arial' color='#006400'>" & strSectionName & "</font></b>" & _
"</td>" & _
"</tr>"
 
Response.Write strBuffer
 
End Sub 'WriteSectionhHeader
 
'=================================================  =====
'Table to display values for Fieldnames and Fieldvalues
'=================================================  =====
 
Sub WriteRow(strFieldName, strFieldValue)
Dim strBuffer
 
strBuffer = "<tr>" & _
"<td align='right' >" & strFieldName & "</td>" & _
"<td>" & strFieldValue & "</td>" & _
"</tr>"
 
Response.Write strBuffer
 
End Sub 'WriteRow
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft Visual Studio 6.0">
</head>
<body>
<center>
<font size="5" face="Arial" color="#228B22"><b>
Student Registration
</b></font>
<div>
<%
Call DisplayFormValues()
%>
<button type="Submit" name="btnReturnPage" OnClick="window.navigate('studentdata.htm')">Finished</button>
</div>
</center>
</body>
</html>

Ok so after they submit this form I want it to go to them in an email kind of for confirmation. Like the exact same form. How would I go about doing that. I know the global.asa would say something and what would go in the actual line of code itself?

Reply With Quote
  #2  
Old April 24th, 2005, 10:47 AM
ADAMWebDesign ADAMWebDesign is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Location: Toronto, Ontario, Canada
Posts: 117 ADAMWebDesign User rank is Private First Class (20 - 50 Reputation Level)ADAMWebDesign User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 12 h 16 m 18 sec
Reputation Power: 4
Code:
Dim Mail_Sender, Email_Body
set Mail_Sender = CreateObject ("CDONTS.NewMail")
Mail_Sender.To = "someemail@domain.com"
Mail_Sender.From = "someotheremail@somewhereelse.com"
Mail_Sender.Subject = "New Student Registration"
(for this part, use Email_Body to create the body of your email containing details of the student registration)
Mail_Sender.Body = Email_Body
Mail_Sender.Send
set Mail_Sender = nothing

If you want additional options (HTML emails, BCCs, etc.) there are lots of tutorials out there. Type 'ASP CDONTS properties" on Google and you'll get a bunch of them.

Reply With Quote
  #3  
Old April 24th, 2005, 12:42 PM
Phoenix's Avatar
Phoenix Phoenix is offline
Web-Standards Evangelist
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Posts: 1,522 Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 23 h 48 m 4 sec
Reputation Power: 8
You shouldn't be using CDONTS since the framework has since been depreciated (back in 2000) in favor of CDO(SYS), which provides more flexibility.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Email?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT