diff --git a/pkg/notify/sender/email.go b/pkg/notify/sender/email.go index 1b0be88921..1662503012 100644 --- a/pkg/notify/sender/email.go +++ b/pkg/notify/sender/email.go @@ -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