Skip to main content
April 6, 2010
Answered

ValueList and dashes

  • April 6, 2010
  • 1 reply
  • 448 views

I am not sure if this is even an issue yet, but was wondering if someone can help me out. I have a simple form on my site that allows my client to mass email all the players in a given team or division. I retrieve the emails from the database and store them as a variable using valuelist, as I wanted my list of emails to be separated by semicolons for use with CFMail. Then I simply feed the variable into a BCC field in the CFMail tag. I was outputting the list to visually verify the results and noticed that whenever a players email comes up with a dash mark in it (example: peter-griffen@name.com) the list will break and wrap at the dash mark. Is there any way to prevent this and just have a continuous list with no breaks in it?

I have yet to test this in the CFMail tag. Does it matter if the string behaves this way? I figured it should just be a continuous string but maybe I am mistaken. Also, do the emails have to be separated by a semicolon or will a simple comma suffice?

Thanks!

T

    This topic has been closed for replies.
    Correct answer ilssac

    That is your browser's doing this not anything ColdFusion is doing.

    You have a very long string, one too long to display on one line I presume.  Thus the browser needs to make a choice where it will wrap the string.  Its first choice would be a space or other white space character.  But I doubt your string has any of those.  So it is falling back on a secondary choice, the hyphen, aka a dash mark.

    If you care, use something like the <pre>...<pre> tag to tell the browser to output the string as is without any HTML formating or wrapping.

    Otherwise just go ahead and use it in your <cfmail...> tag.  It is not trying to display the long string, just use it as data.

    1 reply

    ilssac
    ilssacCorrect answer
    Inspiring
    April 6, 2010

    That is your browser's doing this not anything ColdFusion is doing.

    You have a very long string, one too long to display on one line I presume.  Thus the browser needs to make a choice where it will wrap the string.  Its first choice would be a space or other white space character.  But I doubt your string has any of those.  So it is falling back on a secondary choice, the hyphen, aka a dash mark.

    If you care, use something like the <pre>...<pre> tag to tell the browser to output the string as is without any HTML formating or wrapping.

    Otherwise just go ahead and use it in your <cfmail...> tag.  It is not trying to display the long string, just use it as data.

    April 6, 2010

    Yes, of course.... a pre tag (whodothunk). That worked and I can see the output is undisturbed. Thank you. Does it matter whether you seperate the email addresses by semicolon or comma when using cfmail?

    Cheers,

    TC

    Inspiring
    April 6, 2010
    Does it matter whether you seperate the email addresses by semicolon or comma when using cfmail?

    There's two things I recommend doing when faced with questions like that:

    a) consult the docs: http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_m-o_01.html#2355015;

    b) try it.

    A bit of reading and a bit of experimentation is a good way to find stuff out.

    --

    Adam