jordan-wright / email

Robust and flexible email library for Go
MIT License
2.61k stars 324 forks source link

Support for multiple To, Cc, Bcc addresses with NewEmailFromReader #124

Closed tarmo-randma closed 3 years ago

tarmo-randma commented 3 years ago

In the current version NewEmailFromReader is not handling multiple To, Cc and Bcc addresses as expected.

Eg. For header: To: Jordan Wright <jmwright798@gmail.com>, also@example.com The API would return ["Jordan Wright <jmwright798@gmail.com>, also@example.com"] instead of the expected ["Jordan Wright <jmwright798@gmail.com>", "also@example.com"]

This PR adds support for multiple addresses in the To, Cc and Bcc headers so that in case of a comma separated list of addresses, they would be parsed correctly into multiple entries.

I have also created https://github.com/jordan-wright/email/issues/125 for tracking this issue

jordan-wright commented 3 years ago

LGTM - thanks for sending this in!