CF Mail question, in the output in the mail How do...
# cfml-beginners
j
CF Mail question, in the output in the mail How do I skip a line, I tried <br />, but it just shows up in the mail:
Copy code
<cfmail   to="johnbarr@hawaii.edu" 
          from="john@cfhawaii.net"
          subject="Hawaii ColdFusion User Group Message"
          wraptext="75">
          From: #form.demo_name# (#form.demo_email#)<br />
          Comments: #form.demo_message#                                      </cfmail>
m
if your trying to send html in emails (which will cause your br to work), set the
type="html"
m
For type = text, this might work for a newline character
Copy code
#chr(13)##chr(10)#
j
Copy code
<cfmail 
          to="<mailto:johnbarr@hawaii.edu|johnbarr@hawaii.edu>" 
          from="<mailto:john@cfhawaii.net|john@cfhawaii.net>"
          subject="Hawaii ColdFusion User Group Message" 
          wraptext="75"
          type="html"  
          From: #form.demo_name# (#form.demo_email#)<br />
          Comments: #form.demo_message#
        </cfmail>
This code above throws an error - http://cfhawaii.net/contact.cfm
m
you don't have a closing >
☝️ 1
☝🏻 1
a
There are always specifications for these things. It pays to look them up when one has questions like this. https://www.rfc-editor.org/rfc/rfc5322#section-2.3
j
Copy code
<cfmail 
          to="johnbarr@hawaii.edu" 
          from="john@cfhawaii.net"
          subject="Hawaii ColdFusion User Group Message" 
          wraptext="75"
          type="text/html">
          From: #form.demo_name# (#form.demo_email#)<br />
          Comments: #form.demo_message#
        </cfmail>
This fixed it, thanks so much for the help!
a
It worries me that you are using things from the form scope directly in something leaving your system. Both from a security risk perspective, and from an application architecture one. Something for a different thread though, perhaps.