Sorry, Chris - not Chad. My bad. -Jon On Dec 13, 2006, at 3:55 PM, Jon Clausen wrote:
> No, it should work with any named template. The code example I used > doesn't have the mail server attribute specified though - since the > app I pulled it from has the mailserver defined in the CFAdmin. You > might need to define that. > > To Chad's point earlier, though, if you can implement a site-wide > error handler (and a missing template handler), it's a better method. > > Jon > > On Dec 13, 2006, at 3:47 PM, Chad Gray wrote: > >> Does the file have the be called CFError.cfm? >> >> I just tried your code and it worked... my code I used >> errorpage.cfm and the CFML inside of it never processed. >> >> Thanks! >> Chad >> >> >>> -----Original Message----- >>> From: Jon Clausen [mailto:[EMAIL PROTECTED] >>> Sent: Wednesday, December 13, 2006 3:37 PM >>> To: CF-Talk >>> Subject: Re: notify when server error occurs >>> >>> Chad, >>> >>> I'm sure there are other ways, but here's what I do: >>> >>> In Application.cfm: >>> <cfset ErrorEmail = "[EMAIL PROTECTED]"> >>> <cferror type="Request" template="views/CFError.cfm" >>> mailto="#ErrorEmail#"/> >>> <cferror type="Exception" template="views/CFError.cfm" >>> mailto="#ErrorEmail#"/> >>> >>> CFError.cfm: >>> <cfsetting enablecfoutputonly="true"> >>> <CFIF ERROR.MailTo NEQ ""> >>> <cfmail >>> TO="#ERROR.MailTo#" >>> FROM="#ERROR.MailTo#" >>> SUBJECT="Error on Page #ERROR.Template#" >>> type="html"> >>> <strong>Error Date/Time:</strong> #ERROR.DateTime#<br /> >>> <strong>Browser Information:</strong> #ERROR.Browser#<br /> >>> <strong>URL Parameters:</strong> #ERROR.QueryString#<br /> >>> <strong>Previous Page:</strong> #ERROR.HTTPReferer#<br /><br /> >>> -------------Error Diagnostics----------------<br /> >>> <cfdump var="#Error#"> >>> </cfmail> >>> </CFIF> >>> <cfoutput> >>> <cfinclude template="/views/header.cfm"> >>> <!--content container--> >>> <div id="content"> >>> <h1>We're Sorry, There Was an Error Processing Your Request</h1> >>> <p>Oops,</p> >>> <p>There was an error processing your reqest which prevents us >>> from displaying the information you were looking for. An e-mail has >>> been sent to our system administrator providing detailed information >>> on this request. </p> >>> <p>We will attempt to correct the problem as soon as possible. An >>> e-mail has been sent to the system administrator with detailed >>> information on this error. </p> >>> <p>We apologize for any inconvenience.</p> >>> </div> >>> <cfinclude template="/views/footer.cfm"> >>> </cfoutput> >>> >>> HTH, >>> >>> Jon >>> >>> On Dec 13, 2006, at 3:27 PM, Chad Gray wrote: >>> >>>> What is the best way to have an email sent with error information >>>> when a CF web site throws an error? >>>> >>>> Thanks! >>>> Chad >>> >>> >>> >>> >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263984 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4