Closed
Description
Is your feature request related to a problem? Please describe.
Please consider adding/allowing passing a single string to To/CC. Currently there is an extra check preventing it:
failed to set To address: failed to parse mail address "[email protected],[email protected]", mail: expected single address, got ",[email protected]"
When using
if err := m.To("[email protected],[email protected]"); err != nil {
in https://go-mail.dev/getting-started/introduction/#hl-5-13
Reason being:
- It is perfectly fine to set the "
To:
" header to something like"Alice <[email protected]>, Bob <[email protected]>, Eve <[email protected]>"
in plain email, so such extra checking is too restrictive. - I understand that there might be extra checking on the email address format checking, but since the basic text based unix email doesn't check it, such extra checking can be optional, IMHO. After all, if the user made mistakes in their to/cc email address, they will know eventually.
- And the most important thing is, to add more recipients, I have to change my Go code to do that, whereas the common sense/practice is to change data, not to change code, when covering different cases.
Describe the solution you'd like
Adding/allowing passing a single string to To/CC.
I can work on PR for that.
Describe alternatives you've considered
No response
Additional context
No response
Activity