diff --git a/msgwriter.go b/msgwriter.go index c0e4b88..f386ca7 100644 --- a/msgwriter.go +++ b/msgwriter.go @@ -230,8 +230,12 @@ func (mw *msgWriter) addFiles(fl []*File, a bool) { } if mw.d > 0 { mw.newPart(f.Header) + mw.err = fmt.Errorf("ERROR") + } + + if mw.err == nil { + mw.writeBody(f.Writer, e) } - mw.writeBody(f.Writer, e) } }