Jason
Jason

Reputation: 17956

How do I separate multiple email addresses in cfmail

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?

Upvotes: 7

Views: 11958

Answers (4)

Marcos Placona
Marcos Placona

Reputation: 21720

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.

Upvotes: 5

ale
ale

Reputation: 6430

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.

Upvotes: 5

Adam Tuttle
Adam Tuttle

Reputation: 19804

I think it depends on your mail server. If you're using Exchange, it expects semicolons. Most smtp servers prefer commas. Experiment and see what works for you.

Upvotes: -1

Don Dickinson
Don Dickinson

Reputation: 6258

Comma separate the email addresses is the answer i found in o'reilly's coldfusion book. its possible semi-colons will work, but commas for sure.

-Don

Upvotes: 0

Related Questions