Browse Source

* Sending messages now works as expected

Tyler Akins 24 năm trước cách đây
mục cha
commit
ffdf8c9bc9
2 tập tin đã thay đổi với 10 bổ sung3 xóa
  1. 5 2
      functions/smtp.php
  2. 5 1
      src/compose.php

+ 5 - 2
functions/smtp.php

@@ -409,7 +409,6 @@
          $tmp = nl2br(htmlspecialchars($tmp));
          displayPageHeader($color, 'None');
          include ("../functions/display_messages.php");
-         $lines = nl2br(htmlspecialchars($lines));
          $msg  = "Message not sent!<br>\nReason given: $tmp";
          plain_error_message($msg, $color);
          return(0);
@@ -573,7 +572,11 @@
       }
       sqimap_logout($imap_stream);
       // Delete the files uploaded for attaching (if any).
-      ClearAttachments();
+      // only if $length != 0 (if there was no error)
+      if ($length)
+         ClearAttachments();
+	 
+      return $length;
    }
 
 ?>

+ 5 - 1
src/compose.php

@@ -426,7 +426,11 @@
          set_my_charset();
          do_hook("compose_send");
 
-         if (sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id) == 0) {showInputForm(); exit();}
+         if (! sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id)) {
+	    showInputForm(); 
+	    exit();
+	 }
+	 Header("Location: right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=1");
       } else {
          //$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
          displayPageHeader($color, $mailbox);