* Sending messages now works as expected
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Apr 2001 13:59:59 +0000 (13:59 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Apr 2001 13:59:59 +0000 (13:59 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1295 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/smtp.php
src/compose.php

index 267f1e9efe75fa7441f94bf0512d4d277ee8937e..af8b88454e7e369d04ad3bb49c2cc7d930c209f4 100644 (file)
          $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);
       }
       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;
    }
 
 ?>
index 222851ee2785d96548ea6ba95406428ec02f71c5..33bc51d03a9fec0c934cc20489cf8eec51acf062 100644 (file)
          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);