From 7886efa0aba4eb4f16ce209b14e3ac1c7fac6577 Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 13 Feb 2008 08:34:21 +0000 Subject: Use our internal functions to send a test mail (PEAR::Mail is not bundeled with RoundCube) --- check.php-dist | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/check.php-dist b/check.php-dist index a91c559de..019b033be 100644 --- a/check.php-dist +++ b/check.php-dist @@ -254,8 +254,10 @@ Recipient:
} else { $data = $_POST['smtp_test']; + $CONFIG = $rcmail_config; - require_once 'Mail.php'; + require_once 'lib/rc_mail_mime.inc'; + require_once 'include/rcube_smtp.inc'; $recipients = $rctest_config['from']; @@ -265,32 +267,15 @@ Recipient:
$body = 'This is a test to confirm that RoundCube can send email.'; - $params = array(); - $mail_driver = ''; - - if ($rcmail_config['smtp_server'] != '') { - $mail_driver = 'smtp'; - - if (isset($data['user'])) { - $params['username'] = $data['user']; - $params['password'] = $data['pass']; - $params['auth'] = true; - } - - $params['host'] = $rcmail_config['smtp_server']; - $params['port'] = $rcmail_config['smtp_port']; - - } else { - $mail_driver = 'mail'; - } - - $mail_object =& Mail::factory($mail_driver, $params); - $status = $mail_object->send($recipients, $headers, $body); - if (!PEAR::isError($status)) { + $mail_object = new rc_mail_mime(); + $mail_object->headers($headers); + + $smtp_response = array(); + if (smtp_mail($rctest_config['from'], $recipients, ($foo = $mail_object->txtHeaders($send_headers)), $body, $smtp_response)) { echo 'OK
'; } else { echo 'NOT OK'; - echo '
' . $status->getMessage(); + echo '
' . join('
', $smtp_response); } } } -- cgit v1.2.3