Changeset 1067 in subversion


Ignore:
Timestamp:
Feb 13, 2008 3:34:21 AM (5 years ago)
Author:
thomasb
Message:

Use our internal functions to send a test mail (PEAR::Mail is not bundeled with RoundCube)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/check.php-dist

    r1057 r1067  
    255255 
    256256            $data = $_POST['smtp_test']; 
    257  
    258             require_once 'Mail.php'; 
     257            $CONFIG = $rcmail_config; 
     258 
     259            require_once 'lib/rc_mail_mime.inc'; 
     260            require_once 'include/rcube_smtp.inc'; 
    259261 
    260262            $recipients = $rctest_config['from']; 
     
    266268            $body = 'This is a test to confirm that RoundCube can send email.'; 
    267269 
    268             $params      = array(); 
    269             $mail_driver = ''; 
    270  
    271             if ($rcmail_config['smtp_server'] != '') { 
    272                 $mail_driver = 'smtp'; 
    273  
    274                 if (isset($data['user'])) { 
    275                     $params['username'] = $data['user']; 
    276                     $params['password'] = $data['pass']; 
    277                     $params['auth']     = true; 
    278                 } 
    279  
    280                 $params['host'] = $rcmail_config['smtp_server']; 
    281                 $params['port'] = $rcmail_config['smtp_port']; 
    282  
    283             } else { 
    284                 $mail_driver = 'mail'; 
    285             } 
    286  
    287             $mail_object =& Mail::factory($mail_driver, $params); 
    288             $status = $mail_object->send($recipients, $headers, $body); 
    289             if (!PEAR::isError($status)) { 
     270            $mail_object = new rc_mail_mime(); 
     271            $mail_object->headers($headers); 
     272             
     273            $smtp_response = array(); 
     274            if (smtp_mail($rctest_config['from'], $recipients, ($foo = $mail_object->txtHeaders($send_headers)), $body, $smtp_response)) { 
    290275                echo '<span class="success">OK</span><br />'; 
    291276            } else { 
    292277                echo '<span class="fail">NOT OK</span></span>'; 
    293                 echo '<br />' . $status->getMessage(); 
     278                echo '<br />' . join('<br />', $smtp_response); 
    294279            } 
    295280        } 
Note: See TracChangeset for help on using the changeset viewer.