diff --git a/courier/http_channel.go b/courier/http_channel.go index 97df749e48ae..de45209a1f4e 100644 --- a/courier/http_channel.go +++ b/courier/http_channel.go @@ -4,6 +4,7 @@ package courier import ( + "bytes" "context" "encoding/json" "fmt" @@ -105,9 +106,11 @@ func (c *httpChannel) Dispatch(ctx context.Context, msg Message) (err error) { } err = errors.Errorf( - "unable to dispatch mail delivery because upstream server replied with status code %d", - res.StatusCode, + "unable to dispatch mail delivery because upstream server replied with status code %d and body: %s", + res.StatusCode, + bytes.NewBuffer(x.MustReadAll(res.Body)).String(), ) + logger. WithError(err). Error("sending mail via HTTP failed.")