Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Cfmail is inserting a blank space in front of my email body

$
0
0

While ugly, I'm certain the following will work:

 

<cfmail

to = "#Attributes.To#"

from = "#Attributes.From#"

cc = "#Attributes.CC#"

bcc = "#Attributes.BCC#"

replyTo = "#Attributes.Reply_To#"

subject = "#Attributes.Subject#"

type = "text"

charset="us-ascii"><cfif "#Attributes.EmailUnsubscribeLink#" NEQ ""><cfmailparam name="List-Unsubscribe" value ="<#Attributes.EmailUnsubscribeLink#>"></cfif><cfmailparam name="X-Receiver" value="#xReceivers#"><cfmailparam name="MIME-Version" value="1.0"><cfmailparam name="Content-Transfer-Encoding" value="7bit">#Trim(EmailBody)#</cfmail>

 

I've had problems in the past where the cfif tag leaves whitespace behind when the conditional logic evaluates as false. Placing the entire tag through the close tag seems to correct it.

 

Also notice that I wrapped EmailBody with a Trim().


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>