@@ 157,7 157,6 @@ func EnqueueStd(ctx context.Context, header mail.Header,
cleartext = nopWriteCloser{&buf}
}
}
- defer cleartext.Close()
var inlineHeader mail.Header
inlineHeader.SetContentType("text/plain", map[string]string{
@@ 168,12 167,13 @@ func EnqueueStd(ctx context.Context, header mail.Header,
if err != nil {
panic(err)
}
- defer body.Close()
_, err = io.Copy(body, bodyReader)
if err != nil {
log.Fatal(err)
}
+ body.Close()
+ cleartext.Close()
return queue.Enqueue(NewTask(buf.Bytes(), rcpts))
}