Just a curiosity really. I can't find a reason for it anywhere.

Why doesn't php mail() mailto allow you to use a semicolon to separate the email addresses?

Recommended Answers

From the manual: "The formatting of this string must comply with RFC 2822."

Jump to Post

Yes. The RFC cited in PHP documentation explains that the semicolon is used to separate groups of mails, for example:

To: list-a: abc@localhost.tld, cba@localhost.tld;, list-b: admin@localhost.tld, info@localhost.tld;
Jump to Post

All 5 Replies

From the manual: "The formatting of this string must comply with RFC 2822."

I see.

So it's for compatibility?

Yes. The RFC cited in PHP documentation explains that the semicolon is used to separate groups of mails, for example:

To: list-a: abc@localhost.tld, cba@localhost.tld;, list-b: admin@localhost.tld, info@localhost.tld;

Maybe that's where I'd seen it used before. Cheers guys.

Some mail clients (Outlook) used to allow semi-colons, but only in the interface, when sending the application has to switch to commas.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.