//Make sure we are __not__ connected
if ($this->
connected()) { //Already connected, generate error
$this->
setError('Already connected to a server'
);
return false;
} if (empty($port)) { $port = self::DEFAULT_PORT;
} //Connect to the SMTP server
$this->
edebug( "Connection: opening to
$host:
$port, timeout=
$timeout, options=" .
(count($options) > 0 ?
var_export($options, true
) : 'array()'
),
self::DEBUG_CONNECTION
);
$this->smtp_conn =
$this->
getSMTPConnection($host,
$port,
$timeout,
$options);
if ($this->smtp_conn === false
) { //Error info already set inside `getSMTPConnection()`
return false;
}