Try taking the body content of the message and putting it in a
<cfsavecontent> tag.  Do this before any cfmail tags, then just call the
cfsavecontent variable in the message body.  I've had a similar problem to
yours with a lot of conditional statements in the past and solved it doing
it this way.


Thanks, Mark

-----Original Message-----
From: cf coder [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 10:34 AM
To: CF-Talk
Subject: Re:cfmail pre-formatting

Sorry guys, <cfprocessingdirective suppresswhitespace="yes"> does not work.
I tried what you suggested John, but the email genereated displays
everythign in one line and it does'nt seem to be a elegant solution because
I have more than 50 cfif conditions

>Are you sending TYPE="HTML" or not?  I know I've had some problems in the
>past with plain text emailing in CF.
>
>
>
>I think what you need to do is put everything on one line like this and
>inside your CFIF, put a linebreak character (I think it's CHR(13))
>
>
>
><cfmail from="#frommail#" to="[EMAIL PROTECTED]" server="someserver"
>port="25" subject="Order">
>
>
>
>Any Comments=#AnyComments#<cfif shoppingBasket neq 0>#chr(13)#Shopping
>Basket=#shoppingBasket#</cfif><cfif username neq 0>#chr(13)#User
>Name=#username#</cfif>
>
>
>
></cfmail>
>
>
>
>Let me know if that works for ya.
>
>
>
>John Burns
>
>-----Original Message-----
>From: cf coder [mailto:[EMAIL PROTECTED]
>Sent: Thursday, December 04, 2003 9:09 AM
>To: CF-Talk
>Subject: Re:cfmail pre-formatting
>
>
>
>I've tried that, it doesn't get rid of the line break
>
>>have you tried <cfsetting enablecfoutputonly = "yes"> inside to prevent
any
>>extraneous stuff?
>>
>>...tony
>>
>>tony weeg
>>senior web applications architect
>>navtrak, inc.
>>www.navtrak.net
>>[EMAIL PROTECTED]
>>410.548.2337
>>
>>-----Original Message-----
>>From: cf coder [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, December 04, 2003 9:10 AM
>>To: CF-Talk
>>Subject: cfmail pre-formatting
>>
>>Hello everybody,
>>
>>I have a problem formatting the contents within the body of cfmail. In my
>>cfmail body I have a number of cfif conditions to check if the user has
>>entered any value to form fields.
>>Here is my code:
>><cfmail from="#frommail#" to="[EMAIL PROTECTED]"
>>server="someserver" port="25" subject="Order">
>>
>>Any Comments=#AnyComments#
>><cfif shoppingBasket neq 0>Shopping
>>Basket=#shoppingBasket#</cfif>
>><cfif username neq 0>User Name=#username#</cfif>
>>
>></cfmail>
>>
>>So if someone left the shoppingBasket form field empty, the email
>genereated
>>leaves a space in its place
>>
>>Sample output:
>>
>>Any Comments=test Comments
>>
>>testUserName
>>
>>I don't want to display the line break, I don't understand why cfmail
>>genereated the line break. Can somebody show me how to get round this
>>annoying problem
>>
>>Best Regards
>>CF Coder
>>
>>__________________________________
>>Do you Yahoo!?
>>Free Pop-Up Blocker - Get it now
>>http://companion.yahoo.com/
>>
>
>  _____  
>
>
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to