Here is the code for the asp page. This is the original code page with no modifications.
I'll clarify one point: I need two different emails to come from one asp page. The second email will go to another area, and have different information than the first email.
<!--#INCLUDE FILE=adovbs.inc-->
<%
Response.Write "<html><head><title></title><meta http-equiv=Content-Type content=text/html; charset=iso-8859-1></head>:"
Response.Write "<body bgcolor=#CCCCCC text=#000000>"
Dim adoCon 'Holds the Database Connection Object
Dim rsaddrec 'Holds the recordset for the new record to be added to the database
Dim strSQL 'Holds the SQL query for the database
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../../TechStuff/RequestForm/EmpDbase.mdb") &";"
'Create an ADO recordset object
Set rsaddrec = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Terminations.Facility, Terminations.EffectiveDate, Terminations.LastDayWorked, Terminations.Name, Terminations.Supervisor, Terminations.DateTimeSubmitted FROM Terminations;"
rsaddrec.CursorLocation = adUseClient
'Open the tblComments table using the SQL query held in the strSQL varaiable
rsaddrec.Open strSQL, adoCon, adOpenStatic, adLockOptimistic, adCmdText
'Tell the recordset we are adding a new record to it
rsaddrec.AddNew
'Add new records to the recordset
rsaddrec.Fields("Facility") = Request.Form("Facility")
rsaddrec.Fields("EffectiveDate") = Request.Form("Effective_Date")
rsaddrec.Fields("LastDayWorked") = Request.Form("Last_Day_Worked")
rsaddrec.Fields("Name")=Request.Form("Employee_Name")
rsaddrec.Fields("Supervisor")=Request.Form("Supervisor")
rsaddrec.Fields("DateTimeSubmitted")=now()
'Write the updated recordset to the database
rsaddrec.UPDATE
varNewID = rsaddrec(0)
'Reset server objects
rsaddrec.Close
Set rsaddrec = Nothing
Set adoCon = Nothing
Response.Write "<table border=1>"
Response.Write "<tr><th colspan=2>Form Results</th>"
Response.Write "<tr><th>Employee Number</th><td>" & Request.Form("Employee_Number") & "</td></tr>"
Response.Write "<tr><th>Effective Date</th><td>" & Request.Form("Effective_Date") & "</td></tr>"
Response.Write "<tr><th>Employee Name</th><td>" & Request.Form("Employee_Name") & "</td></tr>"
Response.Write "<tr><th>Type</th><td>" & Request.Form("Type") & "</td></tr>"
Response.Write "<tr><th>Termination Reason</th><td>" & Request.Form("TerminationReason") & "</td></tr>"
Response.Write "<tr><th>Supervisor</th><td>" & Request.Form("Supervisor") & "</td></tr>"
Response.Write "<tr><th>Last Day Worked</th><td>" & Request.Form("Last_Day_Worked") & "</td></tr>"
Response.Write "<tr><th>Pay Through</th><td>" & Request.Form("Pay_through") & "</td></tr>"
Response.Write "<tr><th>Vacation Hours Due</th><td>" & Request.Form("Vacation_Hours_Due") & "</td></tr>"
Response.Write "<tr><th>Severance</th><td>" & Request.Form("Severance") & "</td></tr>"
Response.Write "<tr><th>Remarks</th><td>" & Request.Form("Remarks") & "</td></tr>"
Response.Write "<tr><th>Confirmation</th><td>" & Request.Form("Confirmation") & "</td></tr>"
Response.Write "</table>"
Response.Write "Submittal Date and Time: " & now()
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
HTML = HTML & "<HTML>"
HTML = HTML & "<HEAD>"
HTML = HTML & "<TITLE>Termination Form Results Confirmation</TITLE>"
HTML = HTML & "</HEAD>"
HTML = HTML & "<BODY bgcolor=""#DADADA"">"
HTML = HTML & "<h1>Form Results Confirmation</h1>"
HTML = HTML & "<table border=1>"
HTML = HTML & "<tr><th>Employee Number</th><td>" & Request.Form("Employee_Number") & "</td></tr>"
HTML = HTML & "<tr><th>Effective Date</th><td>" & Request.Form("Effective_Date") & "</td></tr>"
HTML = HTML & "<tr><th>Employee Name</th><td>" & Request.Form("Employee_Name") & "</td></tr>"
HTML = HTML & "<tr><th>Type</th><td>" & Request.Form("Type") & "</td></tr>"
HTML = HTML & "<tr><th>TerminationReason</th><td>" & Request.Form("TerminationReason") & "</td></tr>"
HTML = HTML & "<tr><th>Supervisor</th><td>" & Request.Form("Supervisor") & "</td></tr>"
HTML = HTML & "<tr><th>Last Day Worked</th><td>" & Request.Form("Last_Day_Worked") & "</td></tr>"
HTML = HTML & "<tr><th>Pay through</th><td>" & Request.Form("Pay_through") & "</td></tr>"
HTML = HTML & "<tr><th>Vacation Hours Due</th><td>" & Request.Form("Vacation_Hours_Due") & "</td></tr>"
HTML = HTML & "<tr><th>Severance</th><td>" & Request.Form("Severance") & "</td></tr>"
HTML = HTML & "<tr><th>Remarks</th><td>" & Request.Form("Remarks") & "</td></tr>"
HTML = HTML & "<tr><th>Confirmation</th><td>" & Request.Form("Confirmation") & "</td></tr>"
HTML = HTML & "</table>"
HTML = HTML & "Submittal Time and Date: " & now()
HTML = HTML & "<form name=form1 method=post action=
HTML = HTML & "<input type=hidden name=Employee_Number value=""" & Request.Form("Employee_Number") & """>"
HTML = HTML & "<input type=hidden name=Effective_Date value=""" & Request.Form("Effective_Date") & """>"
HTML = HTML & "<input type=hidden name=Employee_Name value=""" & Request.Form("Employee_Name") & """>"
HTML = HTML & "<input type=hidden name=Type value=""" & Request.Form("Type") & """>"
HTML = HTML & "<input type=hidden name=TerminationReason value=""" & Request.Form("TerminationReason") & """>"
HTML = HTML & "<input type=hidden name=Supervisor value=""" & Request.Form("Supervisor") & """>"
HTML = HTML & "<input type=hidden name=Last_Day_Worked value=""" & Request.Form("Last_Day_Worked") & """>"
HTML = HTML & "<input type=hidden name=Pay_through value=""" & Request.Form("Pay_through") & """>"
HTML = HTML & "<input type=hidden name=Vacation_Hours_Due value=""" & Request.Form("Vacation_Hours_Due") & """>"
HTML = HTML & "<input type=hidden name=Severance value=""" & Request.Form("Severance") & """>"
HTML = HTML & "<input type=hidden name=Remarks value=""" & Request.Form("Remarks") & """>"
HTML = HTML & "<input type=hidden name=Confirmation value=""" & Request.Form("Confirmation") & """>"
HTML = HTML & "<input type=submit name=Complete value=Completed>"
HTML = HTML & "</form>"
HTML = HTML & "</body>"
HTML = HTML & "</HTML>"
objMail.From = Request.Form("Confirmation")
objMail.Subject = "Termination Form Results Confirmation"
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.To = "datacentral@ciionline.com"
objMail.Body = HTML
objMail.Send
set objMail = nothing
Response.Write "</body>"
Response.Write "</html>"
%>