NotifySend.php
authoredward <edward@roojs.com>
Thu, 14 Jul 2016 06:23:36 +0000 (14:23 +0800)
committeredward <edward@roojs.com>
Thu, 14 Jul 2016 06:23:36 +0000 (14:23 +0800)
NotifySend.php

index 6adb538..5da3567 100644 (file)
@@ -377,24 +377,28 @@ class Pman_Core_NotifySend extends Pman
             // this normally will happen if you sent  Pman_Core_NotifySend['host']
             if (isset($ff->Mail['host']) && $ff->Mail['host'] == $mx && !empty($ff->Mail['auth'] )) {
                 
+                $username = $ff->Mail['username'] ;
+                $password = $ff->Mail['password'] ;
+                
                 if(!empty($ff->Core_Notify)){
                     
-                    $preferHost = false;
-                    
                     foreach ($ff->Core_Notify['routes'] as $server => $settings){
                         if(!in_array($dom, $settings['domains'])){
                             continue;
                         }
                         
                         $mailer->host = $server;
+                        $username = $settings['username'];
+                        $password = $settings['password'];
                         
+                        break;
                     }
                     
                 }
                 
                 $mailer->auth = true;
-                $mailer->username = $ff->Mail['username'] ;
-                $mailer->password = $ff->Mail['password'] ;        
+                $mailer->username = $username;
+                $mailer->password = $password;        
             }
             
             $res = $mailer->send($p->email, $email['headers'], $email['body']);