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         
22         foreach ($ff->Core_Notify['routes'] as $server => $settings){
23             if(empty($settings['domains']) || empty($settings['username']) || empty($settings['password'])){
24                 $error[] = "{$server} missing domains / username / password";
25                 continue;
26             }
27             
28             foreach ($settings['domains'] as $dom){
29                 $mailer = Mail::factory('smtp', array(
30                     'host'    => $dom ,
31                     'localhost' => $server,
32                     'timeout' => 15,
33                     'auth' => true,
34                     'username' => $settings['username'],
35                     'password' => $settings['password']
36                 ));
37                 
38                 print_R($mailer);exit;
39             }
40             
41             
42         }
43     }
44     
45 }