Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whitespace in cfmail

Status
Not open for further replies.

jianhua

Programmer
Jun 22, 2001
55
US
Hi,

Did anyone have this experience: when cf tag is inside cfmail, it generates big blank spaces in the mail? For example:
<cfmail ...>
<cfif ...>
#myTest#
</cfif>
body content here...
</cfmail>
Receiver gets email with big blank spaces between #myTest#.

When I move <cfif> outside the <cfmail>, it formats perfectly.

We are using CFMX. Does anyone know how to fix it when I need cf tag inside cfmail?

Thanks in advance!
 
Are you specifying HTML for your &quot;Type&quot; attribute?

Hope This Helps!

Ecobb

&quot;Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.&quot; - Homer Simpson
 
Try it:

<cfmail to=&quot;mailto@someemail.com&quot;
from=&quot;#frommail#&quot;
subject=&quot;Whatever&quot;
type=&quot;HTML&quot;>
<cfif ...>
#myTest#
</cfif>
body content here...
</cfmail>


Hope This Helps!

Ecobb

&quot;Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.&quot; - Homer Simpson
 
If you are still experiencing probs, try:

<cfmail ...><cfif ...>#myTest#</cfif>body content here...</cfmail>

ie. Do not wrap ANY text/code.

When/if you need to force a carriage return, then use the chr() function - #chr(13)##chr(10)# (carriage return / line feed)
 
Many thanks!

Is there any way I can fix it by changing the settings from the administration part? I asked this because we used to have cf4.5 and we didn't have this problem. We upgraded it to CFMX a couple of months ago on both the testing server and the production server. Currently only production server has the problem of generating blank spaces while testing server works fine with the same code. If I change code, we have many places need to change, some even have <cfinclude> inside <cfmail>. I try to find an easy way to solve it. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top