go-gomail / gomail

The best way to send emails in Go.
MIT License
4.37k stars 577 forks source link

Several people on Bcc? #19

Closed siritinga closed 9 years ago

siritinga commented 9 years ago

Hi!

Currently, I'm using msg.SetAddressHeader("Bcc", emailBcc, "bcc") to copy someone while hiding its address. Is the right way to do that? How can I copy more people?

Thanks!

alexcesaro commented 9 years ago

Yes that is the right way. To add more people you can use msg.SetAdressHeader multiple times or you can do:

SetHeader("Bcc", "alice@example.com", "bob@example.com", "carol@example.com")
siritinga commented 9 years ago

Can I use SetAddressHeader multiple times? From the code it looks like every call with the same field string will replace previous entry in the header map.

alexcesaro commented 9 years ago

Yes you're right. So use the second method instead.

siritinga commented 9 years ago

Thanks! and thanks for gomail, is great :+1:

sepehrmm commented 7 years ago

Hi @alexcesaro What if SetAddressHeader is changed to append instead of replace? I don't think it cause any impact.