fix: notify send email with duplicate attachments (#15493)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2022-12-06 15:20:31 +08:00
committed by GitHub
co-authored by Qiu Jian
parent 4c5ed8b537
commit 5fe3ffbf94
+2 -1
View File
@@ -65,7 +65,8 @@ func SendEmail(conf *api.SEmailConfig, msg *api.SEmailMessage) error {
gmsg.SetHeader("Subject", msg.Subject)
gmsg.SetBody("text/html", msg.Body)
for _, attach := range msg.Attachments {
for i := range msg.Attachments {
attach := msg.Attachments[i]
gmsg.Attach(attach.Filename,
mail.SetCopyFunc(func(w io.Writer) error {
mime := attach.Mime