OK, here's the error I'm getting.
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/IntranetForms/DataWHReportHandlingFormTU.asp, line 166
Here's the code I'm using to generate the emails. Please tell me where this missing "if" is. Thanks!
<%
Option Explicit
Dim myMail, myBodyText
%>
<%
' Setup E-mail and send to employee...
Set myMail = Server.CreateObject("CDO.Message")
myMail.From = Request.Form("hidden_associate_email")
' Determines which e-mail address to send the info to
Function SendHelpDeskEmail()
' Setup E-mail and send to Human Resources department...
Set myMail = Server.CreateObject("CDO.Message")
myMail.From = objUpload.Form.Item(5) 'This is the assocaite's e-mail address
myMail.To = "bptouch@healthlink.com"
myMail.Subject = "Data Warehouse Report Handling Request"
'Mymail.BodyFormat = 0
myMail.MailFormat = 0
myBodyText = "HEALTHLINK DATA WAREHOUSE REPORT INFORMATION"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "-------------------------------"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Date Submitted: " & FormatDateTime(date,1)
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Name of Requestor: " & Request.Form("submittor")
If ((Request.Form("submittor") = "")) Then
myBodyText = myBodyText & "Name of Requestor: " & Request.Form("submittor_fname") & " " & Request.Form("submittor_mi") & " " & Request.Form("submittor_lname")
myBodyText = myBodyText & vbCrLf
Else If ((Request.Form("submittor") <> "")) Then
End If
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Type of Report: " & Request.Form("report_type")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Email of Requestor: " & Request.Form("hidden_associate_email")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Name of Owner of Report: " & Request.Form("associate_name")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Names of other users of Report: " & Request.Form("other_users")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Location of Report: " & Request.Form("report_location")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Owner Approval?: " & Request.form("OwnerApprov")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Date Approved: " & Request.Form("date_approved")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Has the report been validated?" & Request.Form("validate")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Validated by: " & Request.Form("validated_by")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Date Validated: " & Request.Form("validated")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "-------------------------------"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Report Categories: " & Request.Form("report_categories")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "-------------------------------"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Report Frequency: " & Request.Form("Report_Freq")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Scheduled Weekly: " & Request.Form("week_freq")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Scheduled Day:" & Request.Form("day")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Scheduled Time:" & Request.Form("hour") & ":" & Request.Form(min) & Request.Form(AM_PM)
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Reason for Other: " & Request.Form("Other")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Date of Start of Report: " & Request.Form("begin_date")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Date of End of Report: " & Request.Form("end_date")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Overwrite report each week?: " & Request.Form("overwrite")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "-------------------------------"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Report Data Source: " & Request.Form("RptDataSrc")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Report Purpose: " & Request.Form("reportpurpose")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Report Categories: " & Request.Form("report_categories")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Report Description : " & Request.Form("reportdesc")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "-------------------------------"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Field Names and Definitions"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & Request.Form("select01") & " " & Request.Form(fieldname01) & " - " & Request.Form(definition01)
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Report Categories: " & Request.Form("report_categories")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Report Categories: " & Request.Form("report_categories")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Report Categories: " & Request.Form("report_categories")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Comments: " & Request.Form("comments")
myMail.TextBody = myBodyText
myMail.Send
Set myMail = Nothing
%>
<%
' Setup E-mail and send to supervisor...
Set myMail = Server.CreateObject("CDO.Message")
myMail.From = "_@wellpoint.com"
myMail.To = Request.Form("hidden_associate_email")
myMail.Subject = "Data Warehouse Report Handling Request Receipt"
'Mymail.BodyFormat = 0
myBodyText = "HEALTHLINK REFERRAL INFORMATION"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "-------------------------------"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "A Data Warehouse Report Handling Request Form has been submitted in your name with the following information:"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Date Referral was Submitted: " & FormatDateTime(date,1)
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Name of Requestor: " & Request.Form("submittor")
If ((Request.Form("submittor") = "")) Then
myBodyText = myBodyText & "Referring Associate's Name: " & Request.Form("hidden_associate_first_name") & " " & Request.Form("hidden_associate_last_name")
Else If ((Request.Form("submittor") <> "")) Then
myBodyText = myBodyText & "Name of Requestor: " & Request.Form("submittor_fname") & " " & Request.Form("submittor_mi") & " " & Request.Form("submittor_lname")
End If
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Referring Associate's E-mail: " & Request.Form("hidden_associate_email")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Contact Name: " & Request.Form("contact_name")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Contact Relationship to Group: " & Request.Form("contact_relationship")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Contact Phone Number: (" & Request.Form("phone_one") & ") " & Request.Form("phone_two") & "-" & Request.Form("phone_three") & " x" & Request.Form("phone_four")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Contact Address: "
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & Request.Form("contact_address_one")
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & Request.Form("contact_city") & ", " & Request.Form("contact_state") & " " & Request.Form("contact_zip_code")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Type of Plan Requested: " & Request.Form("plan_type")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Number of People in Group: " & Request.Form("group_size")
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Comments: " & Request.Form("comments")
myMail.TextBody = myBodyText
myMail.Send
Set myMail = Nothing
%>
If something Then
'something
Else
If something else Then
'something else
' "End If" missing!!! <-------- Will cause error later
End If
'Error - where was that other "End If"?
When what it looks like you want is:
If something Then
'something
ElseIf something else Then
'something else
End If
'This code is happy
Cheers
--Randall