> This must be easy but..... if I have reference to 
> an error display page in the application.cfm file 
> such as: <cferror type="request" template="error_page.cfm" 
> mailto="[EMAIL PROTECTED]">
>  
> how can I get an email sent to the administrator 
> with the error details? I tried putting a CFMail tag 
> in the error_page.cfm file, but that doesn't do it

As you've discovered, the MAILTO attribute of CFERROR doesn't actually send
an email anywhere. All it does is create a variable that will be available
in your error page: Error.MailTo. Also, when using CFERROR TYPE="REQUEST",
you can't use any CFML tags or functions in your error page.

If you want to send an email when an error occurs, take a look at the
site-wide error handler functionality. This is similar to using CFERROR
TYPE="REQUEST", except that you don't have to specify anything in your
Application.cfm code - you configure this in the CF Administrator - and you
can use CFML tags and functions in your error page. Or, alternatively, you
can use CFERROR TYPE="EXCEPTION", which will catch any otherwise unhandled
runtime exceptions; the error page you specify there can also use CFML tags
and functions.

One thing to watch out for, though - if your error page itself generates an
error, odd things might happen. I suspect that's the reason that you can't
use CFML tags and functions in a Request error page. If your site-wide error
handler page generates an error, the user will see the default raw error
message page instead.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to