diff --git a/Net/SMTP.php b/Net/SMTP.php index ab00e4e..a2ccaeb 100644 --- a/Net/SMTP.php +++ b/Net/SMTP.php @@ -213,7 +213,7 @@ public function __construct($host = null, $port = null, $localhost = null, $this->gssapi_cname = $gssapi_cname; /* If PHP krb5 extension is loaded, we enable GSSAPI method. */ - if (extension_loaded('krb5')) { + if (isset($gssapi_principal) && extension_loaded('krb5')) { $this->setAuthMethod('GSSAPI', array($this, 'authGSSAPI')); }