NotifySmtpCheck.php
[Pman.Core] / NotifySmtpCheck.php
1 <?php
2
3 require_once 'Pman.php';
4
5 class Pman_Core_NotifySmtpCheck extends Pman
6 {
7     function check()
8     {
9         $ff = HTML_FlexyFramework::get();
10         
11         if(
12                 empty($ff->Core_Notify) ||
13                 empty($ff->Core_Notify['routes'])
14         ){
15             return;
16         }
17         
18         $error = array();
19         
20 //        require_once "Mail.php";
21         require_once 'Mail/smtpmx.php';
22         
23         foreach ($ff->Core_Notify['routes'] as $server => $settings){
24             if(empty($settings['domains']) || empty($settings['username']) || empty($settings['password'])){
25                 $error[] = "{$server} missing domains / username / password";
26                 continue;
27             }
28             
29             foreach ($settings['domains'] as $dom){
30 //                $mailer = Mail::factory('smtp', array(
31 //                    'host'    => $dom ,
32 //                    'localhost' => $server,
33 //                    'timeout' => 15,
34 //                    'auth' => true,
35 //                    'username' => $settings['username'],
36 //                    'password' => $settings['password']
37 //                ));
38 //                
39 //                print_R($mailer);exit;
40                 
41                 $params = array(
42                     'netdns' => false
43                 );
44                 
45                 $smtpmx = new Mail_smtpmx($params);
46                 
47                 $mx = $smtpmx->_getMx($dom);
48                 
49                 pritn_R($mx);exit;
50             }
51             
52             
53         }
54     }
55     
56 }