<%@ Language=VBScript %> <%'this page is displayed after a form is submitted on erb.asp and an email is sent dim strTitle strTitle="ERB Form - Submitted" Response.Expires = -1 Server.ScriptTimeout = 600 %> <% Dim uploadsDirVar uploadsDirVar = "e:\Intranet Files\ERB_Temp" function SaveFiles Dim Upload, fileName, fileSize, ks, i, fileKey Set Upload = New FreeASPUpload Upload.Save(uploadsDirVar) ' If something fails inside the script, but the exception is handled If Err.Number<>0 then Exit function SaveFiles = "" ks = Upload.UploadedFiles.keys if (UBound(ks) <> -1) then SaveFiles = "File uploaded: " for each fileKey in Upload.UploadedFiles.keys SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) " next Dim EmailBody EmailBody = "

ERB Form Submittal

" EmailBody = EmailBody & "Name of Employee: " & upload.form("Name") & "
" EmailBody = EmailBody & "Date: " & upload.form("theDate") & "
" EmailBody = EmailBody & "Department: " & upload.form("Department") & "
" EmailBody = EmailBody & "Extension: " & upload.form("Extension") & "

" EmailBody = EmailBody & "Name of Referral: " & upload.form("Referralname") & "
" EmailBody = EmailBody & "Referral's Email: " & upload.form("Referralemail") & "
" EmailBody = EmailBody & "Street Address: " & upload.form("Street") & "
" EmailBody = EmailBody & "City: " & upload.form("City") & "
" EmailBody = EmailBody & "State: " & upload.form("State") & "
" EmailBody = EmailBody & "Zip Code: " & upload.form("Zip") & "
" EmailBody = EmailBody & "Main Phone: " & upload.form("Phone") & "
" EmailBody = EmailBody & "Alternate Phone (not required): " & upload.form("AltPhone") & "

" EmailBody = EmailBody & "Job Code (not required): " & upload.form("Jobcode") & "
" EmailBody = EmailBody & "Position Description: " & upload.form("Position") & "
" EmailBody = EmailBody & "Area of Interest (not required): " & upload.form("Interest") & "

" EmailBody = EmailBody & "Attachment: " & upload.form("Attach") & "


" EmailBody = EmailBody & "

Thanks!
" if upload.form("Message")<>"" then EmailBody = EmailBody & "
Message: " & upload.form("Message") & "
" end if ' SEND EMAIL USING CDONTS On Error Resume Next Set Mailer = CreateObject("CDONTS.NewMail") Mailer.From = "hr@company.com" Mailer.To = "hr@company.com" Mailer.Cc = "" Mailer.Subject = " ERB Form Recieved" Mailer.MailFormat = 0 'MIME Mailer.BodyFormat = 0 'html Mailer.Body = EmailBody Dim AttachedFile AttachedFile = uploadsDirVar & "\" & UploadedFiles.FileName 'Response.Write "AttachedFile: " & AttachedFile Mailer.AddAttachment = AttachedFile Mailer.Send If Err.Number <> 0 Then Response.Write "THERE WAS AN ERROR WITH THE CHANGE REQUEST. PLEASE SEE HR

" & "Error: " & Err.Number & " - " & err.description End If if Err.Number > 0 or not err.description = "" Then Response.Write "error num: " & Err.Number & " desc: " & err.description End If set Mailer = nothing else SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system." end if end function %> Employee Referral Program

Employee Referral Program - Submitted...
<%If Err.Number = 0 then %>
Thank You!
<% else %> There was an error: <%Err.Number%><%err.description%> . Your request has not been submitted. Please contact HR. <%end if %>

Here is the information that you entered:

<% Del=Len("

Employee Referral Program.

") Rest=Len(EmailBody) - Del response.write Right(EmailBody, 500) %>

<% ' upload file part Response.Write SaveFiles() %>