From 2c3d81dddd8d931385022a065515d6ef42d7fb7d Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Tue, 21 Jul 2009 08:31:59 -0400
Subject: [PATCH] - use simple rcube_smtp class - Installer: fix SMTP settings test

---
 program/steps/mail/func.inc |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 4486635..b969c04 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -19,8 +19,6 @@
 
 */
 
-require_once('include/rcube_smtp.inc');
-
 $EMAIL_ADDRESS_PATTERN = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9][a-z0-9\-\.]*\\.[a-z]{2,5})';
 
 // actions that do not require imap connection
@@ -1326,8 +1324,12 @@
     unset($message->_headers['Bcc']);
 
     // send message
-    $smtp_response = array();
-    $sent = smtp_mail($from, $a_recipients, ($foo = $message->txtHeaders($send_headers, true)), $msg_body, $smtp_response, $smtp_error);
+    if (!is_object($RCMAIL->smtp))
+      $RCMAIL->smtp_init(true);
+     
+    $sent = $RCMAIL->smtp->send_mail($from, $a_recipients, ($foo = $message->txtHeaders($send_headers, true)), $msg_body);
+    $smtp_response = $RCMAIL->smtp->get_response();
+    $smtp_error = $RCMAIL->smtp->get_error();
 
     // log error
     if (!$sent)

--
Gitblit v1.9.1