%@Language=VBScript%> <%Response.Buffer = True%>
| An error has occured. Bob has been notified. | |
| Description: | <%=strDesc%>. <%=strASPDesc%> |
| Line: | <%=strLine%> |
| File: | <%=strPage%> |
| Code: | <%=strcode%> |
| Source: | <%=strSource%> |
| Remote Address: | <%=strRemoteAddr%> |
| Remote Host: | <%=strRemoteHost%> |
| Local Address: | <%=strLocalAddr%> |
| Error Number: | <%=strNumber%> |
| QueryString (Testing): | <%=strQueryString%> |
| Form Vars (Testing): | <%=strForm%> |
"
HTML = HTML & "" & MAIL_SUBJECT & "
"
HTML = HTML & "Error Report Generated: " & FormatDateTime(now(), vbLongDate) & ", " & FormatDateTime(now(), vbLongTime) & "
"
HTML = HTML & "
"
'Generate the error report general description
HTML = HTML & "Details:
"
HTML = HTML & "Error In Page: " & Request.ServerVariables("PATH_INFO") & "
"
HTML = HTML & "Error Type: " & ErrorType & "
"
HTML = HTML & "Error Source: " & ErrorSource & "
"
HTML = HTML & "Error Number: " & ErrorNumber & "
"
HTML = HTML & "Error Description: " & ErrorDescription & "
"
HTML = HTML & "
"
'Report the contents of the QueryString collection
HTML = HTML & "QueryString Collection:
"
If QS.Count > 0 Then
For Each CollectionItem In QS
HTML = HTML & CollectionItem & " : " & QS(CollectionItem) & "
"
Next
Else
HTML = HTML & "The QueryString collection is empty
"
End If
HTML = HTML & "
"
'Report the contents of the Form collection
HTML = HTML & "Form Collection:
"
If RF.Count > 0 Then
For Each CollectionItem In RF
HTML = HTML & CollectionItem & " : " & RF(CollectionItem) & "
"
Next
Else
HTML = HTML & "The Form collection is empty
"
End If
HTML = HTML & "
"
'Report the Server object properties
HTML = HTML & "Server Settings:
"
HTML = HTML & "ScriptTimeout: " & Server.ScriptTimeout & "
"
HTML = HTML & "
"
'Report the Session object properties and the contents of the Session collection
'IMPORTANT: If you have disabled Sessions either in IIS or
'by use of the @ENABLESESSIONSTATE = FALSE directive then you MUST comment out this section
HTML = HTML & "Session Settings:
"
HTML = HTML & "CodePage: " & Session.CodePage & "
"
HTML = HTML & "LCID: " & Session.LCID & "
"
HTML = HTML & "SessionID: " & Session.SessionID & "
"
HTML = HTML & "Timeout: " & Session.TimeOut & "
"
HTML = HTML & "
"
HTML = HTML & "Session Collection:
"
For iNumber = 1 To Session.Contents.Count
If IsObject(Session.Contents(iNumber)) Then
HTML = HTML & Session.Contents.Key(iNumber) & "[Object]
"
Else
If IsArray(Session.Contents(iNumber)) Then
HTML = HTML & Session.Contents.Key(iNumber) & "[Array]
"
Else
HTML = HTML & Session.Contents.Key(iNumber) & ": " & Session.Contents(iNumber) & "
"
End If
End If
Next
HTML = HTML & "
"
'Report the contents of the Application collection
HTML = HTML & "Application Collection:
"
For iNumber = 1 To Application.Contents.Count
If IsObject(Application.Contents(iNumber)) Then
HTML = HTML & Application.Contents.Key(iNumber) & "[Object]
"
Else
If IsArray(Application.Contents(iNumber)) Then
HTML = HTML & Application.contents.Key(iNumber) & "[Array]
"
Else
HTML = HTML & Application.contents.Key(iNumber) & ": " & Application.Contents(iNumber) & "
"
End If
End If
Next
HTML = HTML & "
"
'Report the contents of the Server Variables collection
HTML = HTML & "Server Variables:
"
For Each CollectionItem in request.servervariables
If CollectionItem <> "ALL_HTTP" and CollectionItem <> "ALL_RAW" then
HTML = HTML & CollectionItem & " : " & request.servervariables(CollectionItem) & "
"
End If
Next
HTML = HTML & ""
HTML = HTML & ""
'Send the error report using email. This currently uses ASPMail from serverobjects.com, but could be
'adapted to use another mail sending object (e.g. CDONTS) if required
'Set myMail = Server.CreateObject("SMTPsvg.Mailer")
'myMail.RemoteHost = MAIL_HOST
'myMail.FromName = MAIL_FROM_NAME
'myMail.FromAddress = MAIL_FROM_EMAIL
'myMail.AddRecipient MAIL_TO_NAME, MAIL_TO_EMAIL
'myMail.Subject = MAIL_SUBJECT
'myMail.BodyText = HTML
'myMail.ContentType = "text/html"
'Send the error report using email. This currently uses CDONTS, but could be
'adapted to use another mail sending object if required
Set myMail = CreateObject("CDONTS.NewMail")
With myMail
.From = MAIL_FROM_NAME & "<" & MAIL_FROM_EMAIL & ">"
.To = MAIL_TO_NAME & "<" & MAIL_TO_EMAIL & ">"
.Subject = MAIL_SUBJECT
.Value("MIME-Version") = "1.1"
.BodyFormat=0
.MailFormat=0
.Body=HTML
.Send
End With
Set myMail = Nothing
End Function
%>