Solved

CFMAIL Error Message Truncated

Posted on 2009-05-08
2
212 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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