From f95d9e7b53d67bbf15be0894cd25acd1c656f0d7 Mon Sep 17 00:00:00 2001 From: fidian Date: Mon, 23 Apr 2001 13:59:59 +0000 Subject: [PATCH] * Sending messages now works as expected git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1295 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/smtp.php | 7 +++++-- src/compose.php | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/functions/smtp.php b/functions/smtp.php index 267f1e9e..af8b8845 100644 --- a/functions/smtp.php +++ b/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!
\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; } ?> diff --git a/src/compose.php b/src/compose.php index 222851ee..33bc51d0 100644 --- a/src/compose.php +++ b/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); -- 2.25.1