source/Core/Email.php
protected function _setSmtpProtocol($url)
    {
        $protocol = '';
        $smtpHost = $url;
        $match = [];
        if (Str::getStr()->preg_match('@^([0-9a-z]+://)?(.*)$@i', $url, $match)) {
            if ($match[1]) {
                if (($match[1] == 'ssl://') || ($match[1] == 'tls://')) {
                    $this->set("SMTPSecure", substr($match[1], 0, 3));
                } else {
                    $protocol = $match[1];
                }
            }
            $smtpHost = $match[2];
        }

        return $protocol . $smtpHost;
    }
protected function _setSmtpProtocol($url)
    {
        $protocol = '';
        $smtpHost = $url;
        $match = [];
        if (Str::getStr()->preg_match('@^([0-9a-z]+://)?(.*)$@i', $url, $match)) {
            if ($match[1]) {
                if (($match[1] == 'ssl://') || ($match[1] == 'tls://')) {
                    $this->set("SMTPSecure", substr($match[1], 0, 3));
                } else {
                    $protocol = $match[1];
                }
            }
            $smtpHost = $match[2];
        }

        return $protocol . $smtpHost;
    }
protected function _setSmtpProtocol ( $ url ) { $ protocol = '' ; $ smtpHost = $ url ; $ match = [ ] ; if ( Str :: getStr ( ) -> preg_match ( '@^([0-9a-z]+://)?(.*)$@i' , $ url , $ match ) ) { if ( $ match [ 1 ] ) { if ( ( $ match [ 1 ] == 'ssl://' ) || ( $ match [ 1 ] == 'tls://' ) ) { $ this -> set ( "SMTPSecure" , substr ( $ match [ 1 ] , 0 , 3 ) ) ; } else { $ protocol = $ match [ 1 ] ; } } $ smtpHost = $ match [ 2 ] ; } return $ protocol . $ smtpHost ; }
Sets smtp parameters depending on the protocol used
returns smtp url which should be used for fsockopen

@param string $url initial smtp

@return string
Sets smtp parameters depending on the protocol used returns smtp url which should be used for fsockopen