Highlighted

Simple formatting in a cfmail query

Community Beginner ,
Jul 24, 2018

Copy link to clipboard

Copied

I am trying to have cfmail send a list (the result of a query) from an access DB. I would like each value separated by some blank lines. I have inserted </br> but they don't get treated as html, they are just sent along with the results:

<cfquery name="P1" datasource="DB"> 

SELECT * FROM Table1

</cfquery>

<cfmail query="P1"

  from='user1@gmail.com'

  to='user2@gmail.com'

  subject='Testing CFMail'>

 

<cfoutput>

     #Col2#</br></br>

</cfoutput>

</cfmail>

The resulting email looks like this:

Result1</br></br>

Result2</br></br>

Result3</br></br>

I would like the </br> treated as html and not included in the email. Any suggestions would be appreciated. TIA.

Add the type="html" attribute to the cfmail tag and remove the leading slash in the br tag.

Cheers

Eddie

TOPICS
Database access

Views

589

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Simple formatting in a cfmail query

Community Beginner ,
Jul 24, 2018

Copy link to clipboard

Copied

I am trying to have cfmail send a list (the result of a query) from an access DB. I would like each value separated by some blank lines. I have inserted </br> but they don't get treated as html, they are just sent along with the results:

<cfquery name="P1" datasource="DB"> 

SELECT * FROM Table1

</cfquery>

<cfmail query="P1"

  from='user1@gmail.com'

  to='user2@gmail.com'

  subject='Testing CFMail'>

 

<cfoutput>

     #Col2#</br></br>

</cfoutput>

</cfmail>

The resulting email looks like this:

Result1</br></br>

Result2</br></br>

Result3</br></br>

I would like the </br> treated as html and not included in the email. Any suggestions would be appreciated. TIA.

Add the type="html" attribute to the cfmail tag and remove the leading slash in the br tag.

Cheers

Eddie

TOPICS
Database access

Views

590

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 24, 2018 0
Advocate ,
Jul 27, 2018

Copy link to clipboard

Copied

Add the type="html" attribute to the cfmail tag and remove the leading slash in the br tag.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2018 0
Community Beginner ,
Jul 27, 2018

Copy link to clipboard

Copied

Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2018 1
BKBK LATEST
Adobe Community Professional ,
Aug 25, 2018

Copy link to clipboard

Copied

Hi mornings80​, please mark the correct answer. That will certainly help someone in future.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 25, 2018 0