Solved

CFMAIL Error Message Truncated

Posted on 2009-05-08
2
210 Views
Last Modified: 2013-12-24
I have an error message handler which e-mail's me of errors on the site.  However, I have noticed on the REQUEST errors, some error messages will include a quotation mark in the error message, which leads the CFMAIL tag to assume the quotation mark is actually closing the CFMAIL tag.  How can I 'encapsulate' the error message so the CFMAIL tag does not thing the quotation mark in the error message is the closing quotation mark for the CFMAIL tag.

In the following code, after the referring page line, a quotation mark in the actual error text appears, which is why there is no explanation of what the error is.
Error Template: /portal/portal/directory/processuser.cfm 

Date Time:Mon Apr 13 09:56:36 GMT-07:00 2009 

Users Browser: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.1; .NET CLR 3.0.04506.648)

Query String: 

Referring Page: https://members.visualeffectssociety.com/portal/portal/directory/user.cfm

Open in new window

0
Comment
Question by:perdiemconsulting
2 Comments
 
LVL 19

Expert Comment

by:erikTsomik
ID: 24338956
can you post some code
0
 
LVL 1

Accepted Solution

by:
zacspam earned 125 total points
ID: 24339213
Without really seeing any code, I'd suggest looking into the DE() function.  You can send your cferror.whatever within a DE() function.

Alternatively, I think you can add a mailto="" attribute to the <cferror> tag, but it has been a while since I tried that.

Hope that helps!


From the Adobe website:

DE()
Escapes any double-quotation marks in the parameter and wraps the result in double-quotation marks.
Postpones evaluation of a string that is passed as a parameter to the IIf or Evaluate functions.

The following example shows how you can use the DE function and number signs together, and shows how the function works with an IIF function:

<cfoutput>
<cfset var1=Blue>
<cfset var2=Green>
<cfset myresult=IIf( 1 eq 2, DE(#Var1#), DE(#Var2#))>
The expression is #myresult#
</cfoutput>

ColdFusion processes this code as follows:

   1. ColdFusion sets the variables var1 and var2 to be the strings Blue and Green.
   2. In the fourth line, ColdFusion evaluates the variables surrounded by number signs first, replacing them with the strings Blue and Green, the values of the variables.
   3. The IIF function evaluates the test expression, determines that it is False, and then evaluates the third parameter.
   4. The third parameter is a DE function, which takes the string Green and surrounds it in quotation marks
   5. The IIF function returns the string "Green", including the quotation marks.
   6. The cfset tag gets the expression result="Green", and sets the value of the myresult variable to the string Green.
   7. ColdFusion evaluates #myresult# in the output text, replaces the variable with its value, the string Green, and displays the result.


http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000458.htm
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now