From 4eb8493b40d72d7895b838234e4bc9bbd2b558ed Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 30 Jun 2010 06:00:06 -0400
Subject: [PATCH] - Fix body in message_sent hook when delay_file_io=true (#1486824)

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

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index e265c9c..4603ad9 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1374,10 +1374,6 @@
     $smtp_response = $RCMAIL->smtp->get_response();
     $smtp_error = $RCMAIL->smtp->get_error();
 
-    if (is_resource($msg_body)) {
-      fclose($msg_body);
-    }
-
     // log error
     if (!$sent)
       raise_error(array('code' => 800, 'type' => 'smtp', 'line' => __LINE__, 'file' => __FILE__,
@@ -1442,6 +1438,10 @@
     }
   }
 
+  if (is_resource($msg_body)) {
+    fclose($msg_body);
+  }
+
   $message->_headers = array();
   $message->headers($headers);
 

--
Gitblit v1.9.1