about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--commands/compose/send.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/commands/compose/send.go b/commands/compose/send.go
index f61478f..849182d 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -320,6 +320,10 @@ func newSmtpSender(ctx sendCtx) (io.WriteCloser, error) {
 		return nil, fmt.Errorf("not an smtp protocol %s", ctx.scheme)
 	}
 
+	if err != nil {
+		return nil, errors.Wrap(err, "Connection failed")
+	}
+
 	saslclient, err := newSaslClient(ctx.auth, ctx.uri)
 	if err != nil {
 		conn.Close()