I am using this to send smtp
. It works for one receiver but I'd like to have multiple receivers. I have tried the following:
func sendemail(body string) {
from := "smtpemail"
pass := "pass"
to := "[email protected],[email protected]"
....
}
I have also tried:
to := "\"[email protected]\",\"[email protected]\""
and:
to := []string{"[email protected]","[email protected]"}
None of them work. Sorry it is so simple, I just begin to work with golang
.
smtp.SendMail
? – putustring
with[]string
simply by+
operator. Quick solution will be replacing... + to
withstrings.Join(to, ",")
. Don't forget to importstrings
package. – putu