@@ -229,6 +229,8 @@ func (e *Email) AttachFile(filename string) (a *Attachment, err error) {
if err != nil {
return
}
+ defer f.Close()
+
ct := mime.TypeByExtension(filepath.Ext(filename))
basename := filepath.Base(filename)
return e.Attach(f, basename, ct)