summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-02-13 08:34:21 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-02-13 08:34:21 +0000
commit2b98fbd177685e37a0c63d0d197efbd22a1b96b2 (patch)
treece3f5ea46b1fb775711d50bd7e2d15ddb82b1588
parentc0e5fb35ace87143951d0cbf1c8985a0f3cf8acd (diff)
Use our internal functions to send a test mail (PEAR::Mail is not bundeled with RoundCube)
git-svn-id: https://svn.roundcube.net/trunk@1067 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/check.php-dist33
1 files changed, 9 insertions, 24 deletions
diff --git a/roundcubemail/check.php-dist b/roundcubemail/check.php-dist
index a91c559de..019b033be 100644
--- a/roundcubemail/check.php-dist
+++ b/roundcubemail/check.php-dist
@@ -254,8 +254,10 @@ Recipient:<br />
} 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:<br />
$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 '<span class="success">OK</span><br />';
} else {
echo '<span class="fail">NOT OK</span></span>';
- echo '<br />' . $status->getMessage();
+ echo '<br />' . join('<br />', $smtp_response);
}
}
}