2 Replies Latest reply on Feb 5, 2013 5:13 PM by Denard Springle

    CF9 cfmail text email - formatting question

    WolfShade Level 4

      Hello, everyone.


      I'm using CFMAIL to send a text-format email whenever a database record is inserted or updated.  Works great, I just have one question.


      Since the information contained is dynamically generated, how can I indent a block of text?  Can't use <blockquote>, that just appears in the email as "<blockquote> text </blockquote>"; it's displayed, not parsed.


      Is there a way to indent a block of text if the email generated is text instead of HTML?





        • 1. Re: CF9 cfmail text email - formatting question
          WolfShade Level 4

          The thought occurred to me as soon as I hit the POST button: If text-formatting strips out all HTML, there is (I'm guessing) no way TO format it, if the text is dynamically generated.


          Sure, if it is hard-coded, static text, you can use spaces on every line to faux-indent the text.  But dynamically generated, most likely it's a pain to do, if it can be done.


          So, I guess I'm just hoping for other people's thoughts?





          • 2. Re: CF9 cfmail text email - formatting question
            Denard Springle Level 1

            chr() is your best bet to format plain text emails for indentation. For example, chr(9) will give you a tab character, which should indent the text in the email based on the email clients interpretation of a tab (usually 4 or 8 spaces, depending on the email client) Any ASCII code (http://www.asciitable.com/) can be used with chr() in plain text emails. I use it all the time.


            An alternative would be RepeatString(), which would allow you to indent the number of spaces you prefer.


            With dynamically generated content, you may have to append the chr() code to the string before it's added to the email (e.g. parse the query and add in the chr() codes you need). Ultimately, you're better off in either case *not* using the dynamic functions and formatting it the way you want by looping through the query in question and outputing the formatted text the way you want with each record.




            -- Denny