Procedure EVENT_Error * Replace the dynamic parts of the error HTML and send by mail Local lcMail, lcFailed lcFailed = "" lcMail = Error.ErrorHtml() lcMail = Strtran( m.lcMail, "display:none", "" ) Try SendEmail( ; m.lcMail, ; "App name: " + Error.cMessage, ; "Empfänger=rec@server.com" ; ) Catch lcFailed = " (Modul k.FM)" EndTry * Display a generic error message Response.Clear() Server.Transfer( ; "error.afp?msg="+Server.URLEncode("Your request cannot be processed at this time. Please try again later."+m.lcFailed) ; ) * Close files Close Databases Close Databases all * Cancel execution. Without CANCEL AFP would continue with the next line in the current page Cancel EndProcSendEMail is a function in my utility library. It uses BLAT.DLL to send an error message.