diff --git a/utils/mail.go b/utils/mail.go index 42b1e4d4..80a366ca 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -175,6 +175,7 @@ func (e *Email) AttachFile(args ...string) (a *Attachment, err error) { if err != nil { return } + defer f.Close() ct := mime.TypeByExtension(filepath.Ext(filename)) basename := path.Base(filename) return e.Attach(f, basename, ct, id)