VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



When an error occurs on one of your ASP pages, this sub will email you a notification of that error

by Tony Heishman (2 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Thu 25th May 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

When an error occurs on one of your ASP pages, this sub will email you a notification of that error and show the user friendly error page.

Rate When an error occurs on one of your ASP pages, this sub will email you a notification of that error





<%
'*******************************************************************************
'This section traps errors and emails you a report of it and displays a user friendly error page.
'*******************************************************************************

sub OnTransactionAbort()
     response.clear
     response.write "An error was encountered processing your information."&"<br>"
     response.write "Please click the HOME button in your browser and try again."&"<br>"
     response.write "A notice of this error has been sent to the web administrators."&"<br>"
     response.write "Thank you for your patience."
     
     SET objMail=Server.CreateObject("CDONTS.Newmail")
     objMail.From = "[email protected]
objMail.To = "[email protected]" 'your email address
     objMail.Subject = "!!Error At Web Site!!"
     objMail.Body = "On " & now() &_
        ", the following error was " &_
        "generated in page " &_
        Request.ServerVariables( "SCRIPT_NAME" ) &_
        ": " & vbnewline & vbnewline &_
        err.Description 
     objMail.Importance = 2
     objMail.Send
     Set objMail = Nothing
end sub %>


Download this snippet    Add to My Saved Code

When an error occurs on one of your ASP pages, this sub will email you a notification of that error Comments

No comments have been posted about When an error occurs on one of your ASP pages, this sub will email you a notification of that error. Why not be the first to post a comment about When an error occurs on one of your ASP pages, this sub will email you a notification of that error.

Post your comment

Subject:
Message:
0/1000 characters