We recently upgraded to ColdFusion 2016 having run ColdFusion for over a decade. Most everything has gone well except a weird issue with email. Every CFMAIL function now strips out spaces when displaying multiple variables in a row.
For example, many automated reports that generated output through CFMAIL have something like this in the code:
<cfquery name="GetUsers" datasource="database">
Select User_Name_F, User_Name_L
Where Active = 1
Order By User_Name_L, User_Name_F
Output Code (in body of CFMAIL tag):
Output Result (in multiple email clients):
Before the upgrade this displayed as "John Doe" correctly with the space between names and has for years. I can force a blank space by hard-coding it in, which I shouldn't have to do. I can also do a "Select (User_Name_F + ' ' + User_Name_L) as name" and make it work, but many times I will use the first and last names in different orders in the same output, so I shouldn't have to do this either. The same issue occurs from queries from MySQL 5 and Microsoft SQL Server. The same issue occurs with variables from queries as well as variables created using CFSET.
Is this a bug? What am I missing?
We are seeing the same behavior after moving to CF 2016, but you are further ahead in your troubleshooting. Did you file file a bug report at bugbase.adobe.com?
Just an FYI - I have a report in adobe's bugbase (4187127) that has been verified and is slated to be fixed. When that happens though - who knows.
As a temporary work-around, would using a non-breaking space be acceptable?
P.S. Sorry, the editor interprets the nbsp and doesn't show it. I inserted a space to defeat it!
Anyone know if there's been any new information on this? I am running on the latest patch and it still is an issue.
Yep, still an issue with update 3. Adobe claims its fixed in the bug tracker but doesn't say what version its fixed in. I'm thinking maybe the fix may have just missed making it into update 3 so I expected Update 4 (I was guessing around December) would have it, but in December they put out a repackaged installer instead. So maybe in March we will get Update 4 which HOPEFULLY will contain the fix, but its all just speculation (and hope) on my part. Waaaay too long to wait for a much needed simple fix though....
Agreed, and this is something that is a bit perplexing as to why it even exists. I've employed the workaround with limited success but that only seems to help in specific isolated cases.
Guess we can just hurry up and wait
I am curious to know if anyone using the repackaged installer is seeing this issue.I know the repackaged installer came with a newer JRE, and I was curious if somehow it was actually a java bug that caused this.
Found a hack in the meantime. If you use CFINCLUDE for the body of the CFMAIL, it will properly handle the content.
Note that you must include a CFOUTPUT inside the include.
#var1# #var2# #var3#
You can also fix it with cfsavecontent to avoid needing a separate file...
<cfsavecontent variable="request.emailBody" >
Name: #request.name_first# #request.name_last#
Still happening for me on Product Version: