如何使用Go在电子邮件中包含抄送和密件抄送

How to add CC and BCC on my email function in Go.

Here is my code

err := smtp.SendMail(
 "smtp.zoho.com",
 587,
 config.Email_id,
 config.Email_password,
 []string{email_to},

That depends on which mail library you're using. But the short version is: Just add the Cc: and Bcc: headers as usual, same as you do for any other header, such as Subject: or To:.

I used this library for cc, bcc. It has more features too.

Here's the link

https://github.com/jordan-wright/email