0

Are there any conventions or accepted best practices for how to format an email "to" field.

For example, in gmail you can do things like

"John Doe <johndoe@example.com>, janedoe@example.com"

I am guessing there has to be an accepted standard somewhere, but I can't find it because searching for "email to field" on google is a pointless task.

I am asking because I am building a messaging system, and I can't figure out what convention I should allow my users to use in the "to" field. Some people use things like

"John Doe <johndoe-work@gmail.com,johndoe-home@gmail.com>"

and that's not a valid format.

Also, I am using Ruby, so if anyone knows a gem to automate this, I would appreciate it.

vinhboy
  • 8,542
  • 7
  • 34
  • 44
  • This is specified by the IETF in the RFCs for email. See [this answer](http://stackoverflow.com/a/574698/62576) to a related question for links and a discussion of those RFCs. – Ken White May 17 '13 at 19:31

1 Answers1

0

To assign multiple recipients to the email header you have to separate them with commas.

To: su@example.com, Ted <ted@example.com>, Ina Mako <ina.mako@example.com> 

I found this info everywhere, so I will not mark a source.

Patartics Milán
  • 4,858
  • 4
  • 26
  • 32