paulferree wrote:
Why is this code not working...it's still crashing and giving me a CF error:
Because you have a syntax error. Syntax errors are found at time of
compilation. <try><catch> blocks can only handle errors during
execution after the code has been compiled.
This more legitimate code example should show the behavior you desire.
<cftry>
<cfset bademail = "">
<cfmail to="#bademail#" from="noreply@xxxxxxxxxxxxxx"
failto="paulferree@xxxxxxxxx"
subject="Test email" >
This is a test
</cfmail>
<cfcatch type="any">
An error has occurred.<br>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
|