diff --git a/smtp/smtp.go b/smtp/smtp.go index 7c39996..d713f8c 100644 --- a/smtp/smtp.go +++ b/smtp/smtp.go @@ -593,7 +593,6 @@ func (c *Client) GetTLSConnectionState() (*tls.ConnectionState, error) { if !c.isConnected { return nil, ErrNoConnection - } if !c.tls { return nil, ErrNonTLSConnection diff --git a/smtp/smtp_test.go b/smtp/smtp_test.go index 7b53963..4fd32eb 100644 --- a/smtp/smtp_test.go +++ b/smtp/smtp_test.go @@ -1811,6 +1811,7 @@ func TestClient_GetTLSConnectionState_unableErr(t *testing.T) { <-clientDone <-serverDone } + func TestClient_HasConnection(t *testing.T) { ln := newLocalListener(t) defer func() {