public function sendSMTP($to, $from, $message)
    {
        $host = __config()->email->smtp_host;
        $user = __config()->email->smtp_user;
        $pass = __config()->email->smtp_pass;
        $port = __config()->email->smtp_port;
        if ($h = fsockopen($host, $port)) {
            $data = [
                0,
                "EHLO $host",
                'AUTH LOGIN',
                base64_encode($user),
                base64_encode($pass),
                "MAIL FROM: <$from>",
                "RCPT TO: <$to>",
                'DATA',
                $message,
            ];
            foreach ($data as $c) {
                $c && fwrite($h, "$c\r\n");
                while (substr(fgets($h, 256), 3, 1) != ' ') {
                }
            }
            fwrite($h, "QUIT\r\n");

            return fclose($h);
        }
    }
public function sendSMTP($to, $from, $message)
    {
        $host = __config()->email->smtp_host;
        $user = __config()->email->smtp_user;
        $pass = __config()->email->smtp_pass;
        $port = __config()->email->smtp_port;
        if ($h = fsockopen($host, $port)) {
            $data = [
                0,
                "EHLO $host",
                'AUTH LOGIN',
                base64_encode($user),
                base64_encode($pass),
                "MAIL FROM: <$from>",
                "RCPT TO: <$to>",
                'DATA',
                $message,
            ];
            foreach ($data as $c) {
                $c && fwrite($h, "$c\r\n");
                while (substr(fgets($h, 256), 3, 1) != ' ') {
                }
            }
            fwrite($h, "QUIT\r\n");

            return fclose($h);
        }
    }
public function sendSMTP ( $ to , $ from , $ message ) { $ host = __config ( ) -> email -> smtp_host ; $ user = __config ( ) -> email -> smtp_user ; $ pass = __config ( ) -> email -> smtp_pass ; $ port = __config ( ) -> email -> smtp_port ; if ( $ h = fsockopen ( $ host , $ port ) ) { $ data = [ 0 , "EHLO $host" , 'AUTH LOGIN' , base64_encode ( $ user ) , base64_encode ( $ pass ) , "MAIL FROM: <$from>" , "RCPT TO: <$to>" , 'DATA' , $ message , ] ; foreach ( $ data as $ c ) { $ c && fwrite ( $ h , "$c\r\n" ) ; while ( substr ( fgets ( $ h , 256 ) , 3 , 1 ) != ' ' ) { } } fwrite ( $ h , "QUIT\r\n" ) ; return fclose ( $ h ) ; } }
Send mail over SMTP.

@param $to sender email
$from from email
$message message to be send

@since 1.9.0

@return bool
Send mail over SMTP .