NotifySmtpCheck.php
[Pman.Core] / NotifySmtpCheck.php
index d693ab8..35aa7b6 100644 (file)
@@ -27,6 +27,17 @@ class Pman_Core_NotifySmtpCheck extends Pman
             return;
         }
         
+        $ifconfig = file_get_contents("https://ifconfig.co/");
+        $dom = new DomDocument('1.0', 'utf-8');
+        $dom->loadHTML($ifconfig);
+        
+        $xpath = new DOMXPath($dom);
+        
+        $lists = $xpath->query("code[@class='ip]");
+        
+        
+        print_R($lists);exit;
+        
         $error = array();
         
         foreach ($ff->Core_Notify['routes'] as $server => $settings){
@@ -36,23 +47,6 @@ class Pman_Core_NotifySmtpCheck extends Pman
             }
             
             foreach ($settings['domains'] as $dom){
-//                $mailer = Mail::factory('smtp', array(
-//                    'host'    => $dom ,
-//                    'localhost' => $server,
-//                    'timeout' => 15,
-//                    'auth' => true,
-//                    'username' => $settings['username'],
-//                    'password' => $settings['password']
-//                ));
-//                
-//                print_R($mailer);exit;
-                
-//                $params = array(
-//                    'netdns' => false
-//                );
-                
-//                $smtpmx = new Mail_smtpmx($params);
-//                $smtpmx->debug = true;
                 
                 $socket_options = array (
                     'ssl' => array(
@@ -62,12 +56,9 @@ class Pman_Core_NotifySmtpCheck extends Pman
                     )
                 );
                 
-                $smtp = new Net_SMTP($server, 25, '058177247238.ctinets.com', false, 0, $socket_options);
+                $smtp = new Net_SMTP($server, $settings['port'], '058177247238.ctinets.com', false, 0, $socket_options);
                 
                 $smtp->setDebug(true);
-//                print_R($smtp);
-                
-//                print_R($smtpmx->_smtp);exit;
                 
                 $res = $smtp->connect(10);
                 
@@ -83,21 +74,7 @@ class Pman_Core_NotifySmtpCheck extends Pman
                 
                 print_R("SUCCESS? {$res} \n");
                 exit;
-                    
-//                $mx = $smtpmx->_getMx($dom);
-//                
-//                foreach ($mx as $mserver => $mpriority) {
-//                    
-//                    $smtpmx->_smtp = new Net_SMTP($mserver, $smtpmx->port, $smtpmx->mailname);
-//                    
-////                    print_R($smtpmx);exit;
-//                    $res = $smtpmx->_smtp->connect($smtpmx->timeout);
-//
-//                    $smtpmx->_smtp->disconnect();
-//                    
-//                    print_R($res);exit;
-//                }
-                
+                   
             }