How do I separate multiple email addresses in cfmail

10,933

Solution 1

Per https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-m-o/cfmail.html

Message recipient e-mail addresses:

  • Static address, for example, "[email protected]".
  • Variable that contains an address, for example, "#Form.Email#".
  • Name of a query column that contains an address, for example, "#EMail#". An e-mail message is sent for each returned row.

To specify multiple addresses, separate the addresses with commas.

(emphasis mine)

I do believe semicolons will work as well.

Solution 2

You can use either of them, and it should be fine. Although for consistency with existing email clients, I'd use a semicolon.

I'm not sure how commas would behave in other CF engines, such as Railo or OpenBD, whereas ; would work on all of them.

Share:
10,933
Jason
Author by

Jason

I am the Manager of Application Programming for the Informatics group at Purdue University where I'm responsible for providing development in the areas of research, teaching, and learning. My experience includes application development, project management, and driving new and creative Web and Mobile strategies. The work of my group has been featured by the New York Times, CNET, and The Chronicle of Higher Education.

Updated on June 25, 2022

Comments

  • Jason
    Jason almost 2 years

    Do I use a comma or semicolon? I can't seem to find it in the live docs. I also can't seem to find any consistency looking online as some examples use a comma while others use a semicolon. Are both acceptable?