0
Contributor
,
/t5/coldfusion-discussions/need-help-on-carriage-return-line-feed/td-p/324719
Jul 18, 2007
Jul 18, 2007
Copy link to clipboard
Copied
Hi,
I have a variable defined for a new line, e.g. <CFSET NewLine = "#chr(13)##chr(10)#">, that I use as a break between lines of text within CFMAIL.
<CFSET Message = NewLine & "Product Name: " & Trim(GetProduct.ProductName) & NewLine>
<CFSET Message = Message & "Product Description: " & Trim(GetProduct.ProductDesc) & NewLine>
<CFSET Message = Message & "Product Color: " & Trim(GetProduct.ProductColor) & NewLine>
<CFMAIL FROM="MyEmailAddress@MyDomain.com" TO="SomeOne@SomeCompany.com" SUBJECT="Product Info">#Message#</CFMAIL>
If the email is sent to and open up in Microsoft Outlook account (mailbox), the "Product Description" line of text would stay on the same line as the Product Name (when LEN(GetProduct.ProductName) > 50). In other words, the NewLine variable is not doing the break. The code works with yahoo or hotmail account though.
Any advice is greatly appreciated.
Thanks in advance!
I have a variable defined for a new line, e.g. <CFSET NewLine = "#chr(13)##chr(10)#">, that I use as a break between lines of text within CFMAIL.
<CFSET Message = NewLine & "Product Name: " & Trim(GetProduct.ProductName) & NewLine>
<CFSET Message = Message & "Product Description: " & Trim(GetProduct.ProductDesc) & NewLine>
<CFSET Message = Message & "Product Color: " & Trim(GetProduct.ProductColor) & NewLine>
<CFMAIL FROM="MyEmailAddress@MyDomain.com" TO="SomeOne@SomeCompany.com" SUBJECT="Product Info">#Message#</CFMAIL>
If the email is sent to and open up in Microsoft Outlook account (mailbox), the "Product Description" line of text would stay on the same line as the Product Name (when LEN(GetProduct.ProductName) > 50). In other words, the NewLine variable is not doing the break. The code works with yahoo or hotmail account though.
Any advice is greatly appreciated.
Thanks in advance!
TOPICS
Getting started
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Contributor
,
Jul 26, 2007
Jul 26, 2007
The trick is to add 3 blank spaces (" " ) at the end of each
line but before the break (NewLine) such as these:
<CFSET NewLine = "#chr(13)##chr(10)#">
<CFSET Message = NewLine & "Product Name: " & Trim(GetProduct.ProductName) & " " & NewLine>
<CFSET Message = Message & "Product Description: " & Trim(GetProduct.ProductDesc) & " " & NewLine>
<CFSET Message = Message & "Product Color: " & Trim(GetProduct.ProductColor) & NewLine>
<CFMAIL FROM="MyEmailAddress@MyDomain.com" TO="SomeOne@SomeCompany....
<CFSET NewLine = "#chr(13)##chr(10)#">
<CFSET Message = NewLine & "Product Name: " & Trim(GetProduct.ProductName) & " " & NewLine>
<CFSET Message = Message & "Product Description: " & Trim(GetProduct.ProductDesc) & " " & NewLine>
<CFSET Message = Message & "Product Color: " & Trim(GetProduct.ProductColor) & NewLine>
<CFMAIL FROM="MyEmailAddress@MyDomain.com" TO="SomeOne@SomeCompany....

/t5/coldfusion-discussions/need-help-on-carriage-return-line-feed/m-p/324720#M29342
Jul 19, 2007
Jul 19, 2007
Copy link to clipboard
Copied
It is likely the e-mail is being interpreted as HTML, so
13-10 does not do the job. Try this:
<CFSET NewLine = "<BR>">
<CFSET NewLine = "<BR>">
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
AppDeveloper-Sp9Jq0
AUTHOR
Contributor
,
/t5/coldfusion-discussions/need-help-on-carriage-return-line-feed/m-p/324721#M29343
Jul 23, 2007
Jul 23, 2007
Copy link to clipboard
Copied
No, <CFSET NewLine = "<BR>"> won't work. It only
happens to Outlook, so I'll just live with it.
Thanks for your help anyway!
Thanks for your help anyway!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Contributor
,
LATEST
/t5/coldfusion-discussions/need-help-on-carriage-return-line-feed/m-p/324722#M29344
Jul 26, 2007
Jul 26, 2007
Copy link to clipboard
Copied
The trick is to add 3 blank spaces (" " ) at the end of each
line but before the break (NewLine) such as these:
<CFSET NewLine = "#chr(13)##chr(10)#">
<CFSET Message = NewLine & "Product Name: " & Trim(GetProduct.ProductName) & " " & NewLine>
<CFSET Message = Message & "Product Description: " & Trim(GetProduct.ProductDesc) & " " & NewLine>
<CFSET Message = Message & "Product Color: " & Trim(GetProduct.ProductColor) & NewLine>
<CFMAIL FROM="MyEmailAddress@MyDomain.com" TO="SomeOne@SomeCompany.com" SUBJECT="Product Info">#Message#</CFMAIL>
<CFSET NewLine = "#chr(13)##chr(10)#">
<CFSET Message = NewLine & "Product Name: " & Trim(GetProduct.ProductName) & " " & NewLine>
<CFSET Message = Message & "Product Description: " & Trim(GetProduct.ProductDesc) & " " & NewLine>
<CFSET Message = Message & "Product Color: " & Trim(GetProduct.ProductColor) & NewLine>
<CFMAIL FROM="MyEmailAddress@MyDomain.com" TO="SomeOne@SomeCompany.com" SUBJECT="Product Info">#Message#</CFMAIL>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

