NotifySmtpCheck.php
[Pman.Core] / NotifySmtpCheck.php
index 666197a..89c15b2 100644 (file)
@@ -6,12 +6,26 @@ require_once 'Mail/smtpmx.php';
         
 class Pman_Core_NotifySmtpCheck extends Pman
 {
+    function get()
+    {
+        $this->check();
+    }
+    
     function check()
     {
         $ff = HTML_FlexyFramework::get();
         
+        if(
+                empty($ff->Core_Notify) ||
+                empty($ff->Core_Notify['routes'])
+        ){
+            return;
+        }
+        
         $helo = $this->getHelo();
         
+        echo "HELO : {$helo} \n";
+        
         $error = array();
         
         foreach ($ff->Core_Notify['routes'] as $server => $settings){
@@ -29,8 +43,10 @@ class Pman_Core_NotifySmtpCheck extends Pman
 
             $smtp = new Net_SMTP($server, $settings['port'], $helo, false, 0, $socket_options);
 
-            $smtp->setDebug(true);
-
+//            $smtp->setDebug(true);
+            
+            echo "Connecting : {$server}:{$settings['port']} \n";
+            
             $res = $smtp->connect(10);
 
             if (is_a($res, 'PEAR_Error')) {
@@ -38,6 +54,8 @@ class Pman_Core_NotifySmtpCheck extends Pman
                 continue;
             }
 
+            echo "Login As : {$settings['username']}:{$settings['password']} \n";
+            
             $res = $smtp->auth($settings['username'], $settings['password']);
 
             if (is_a($res, 'PEAR_Error')) {
@@ -46,7 +64,12 @@ class Pman_Core_NotifySmtpCheck extends Pman
             }
         }
         
-        return $error;
+        if(!empty($error)){
+            print_r($error);
+            exit;
+        }
+        
+        return;
     }
     
     function getHelo()