isValidHost example

$this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry));
                //Not a valid host entry                 continue;
            }
            //$hostinfo[1]: optional ssl or tls prefix             //$hostinfo[2]: the hostname             //$hostinfo[3]: optional port number             //The host string prefix can temporarily override the current setting for SMTPSecure             //If it's not specified, the default value is used
            //Check the host name is a valid name or IP address before trying to use it             if (!static::isValidHost($hostinfo[2])) {
                $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]);
                continue;
            }
            $prefix = '';
            $secure = $this->SMTPSecure;
            $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure);
            if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) {
                $prefix = 'ssl://';
                $tls = false; //Can't have SSL and TLS at the same time                 $secure = static::ENCRYPTION_SMTPS;
            } elseif ('tls' === $hostinfo[1]) {
                
Home | Imprint | This part of the site doesn't use cookies.