Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CFMAIL Error Message Truncated

Posted on 2009-05-08
2
Medium Priority
?
218 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 500 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Loops Section Overview

916 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