added saving attachments again, and removed a "click here" screen after
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 15 Mar 2000 13:37:26 +0000 (13:37 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 15 Mar 2000 13:37:26 +0000 (13:37 +0000)
composing a message.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@308 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php
functions/smtp.php
src/compose.php

index c97bf43ddec03795610d3dba28727ec589569d03..3e8258292270258ac7c481d69890ddf73f126261 100755 (executable)
       $from_addr = getPref($data_dir, $username, "email_address");
       if ($from_addr == "")
          $from_addr = "$username@$domain";
       $from_addr = getPref($data_dir, $username, "email_address");
       if ($from_addr == "")
          $from_addr = "$username@$domain";
-      $to_list = getLineOfAddrs($to);
-      $cc_list = getLineOfAddrs($cc);
-      $bcc_list = getLineOfAddrs($bcc);
 
       if ($from == "")
          $from = "<$from_addr>";
 
       if ($from == "")
          $from = "<$from_addr>";
          $from = $from . " <$from_addr>";
 
       $message  = "Date: ".date("D, j M Y H:i:s ", mktime()) . timezone() . "\r\n";
          $from = $from . " <$from_addr>";
 
       $message  = "Date: ".date("D, j M Y H:i:s ", mktime()) . timezone() . "\r\n";
-      $message .= "Subject: $subject\r\n";
-      $message .= "From: $from\r\n";
-      $message .= "To: $to_list\r\n";
+      $message .= "Subject: ". $subject."\r\n";
+      $message .= "From: ".$from."\r\n";
+      $message .= "To: ".$to."\r\n";
       if ($cc_list) {
       if ($cc_list) {
-         $message .= "Cc: $cc_list\r\n"; // Who the CCs are
+         $message .= "Cc: ".$cc."\r\n"; // Who the CCs are
       }
       $message .= "Content-Type: text/plain; charset=ISO-8859-1\r\n";
       $message .= "Content-Transfer-Encoding: 8bit\r\n";
       $message .= "\r\n";
       }
       $message .= "Content-Type: text/plain; charset=ISO-8859-1\r\n";
       $message .= "Content-Transfer-Encoding: 8bit\r\n";
       $message .= "\r\n";
-      $message .= "$body\r\n";
+      $message .= stripslashes($body) . "\r\n";
       $message .= "\r\n";
       
       $size = count_chars($message);
       fputs ($imap_stream, "a001 APPEND $sent_folder (\\Seen) \{$size}\r\n");
       fputs ($imap_stream, "$message");
       $message .= "\r\n";
       
       $size = count_chars($message);
       fputs ($imap_stream, "a001 APPEND $sent_folder (\\Seen) \{$size}\r\n");
       fputs ($imap_stream, "$message");
-      echo "a001 APPEND $sent_folder (\\Seen) \{$size}<br>";
 
       $read_ary = sqimap_read_data ($imap_stream, "a001", true, $result, $message);
 
       $read_ary = sqimap_read_data ($imap_stream, "a001", true, $result, $message);
-      for ($i = 0; $i < count($read_ary); $i++) {
-         echo $read_ary[$i] . "<BR>";
-      }
    } 
 ?>
    } 
 ?>
index 68f4048f7ef784c428b7966e783b4ccbf5a5b0ec..2e0e6099ca98f3dcc12abbf1ed6319d39be4606c 100644 (file)
          sendSMTP($t, $c, $b, $subject, $body);
       }
 
          sendSMTP($t, $c, $b, $subject, $body);
       }
 
-//      $imap_stream = sqimap_login($username, $key, $imapServerAddress, 1);
-//      sqimap_append ($imap_stream, $sent_folder, $body, $t, $c, $b, $subject, $data_dir, $username, $domain, $version);    
+      $imap_stream = sqimap_login($username, $key, $imapServerAddress, 1);
+      sqimap_append ($imap_stream, $sent_folder, $body, $t, $c, $b, $subject, $data_dir, $username, $domain, $version);    
    }
 
 ?>
    }
 
 ?>
index 83c7bb5467f5a81c602eb71e95fa85d1a8e97112..adcac3e5f63084bae14a65e9d3b4a78dfe03dd3d 100644 (file)
 
    include("../src/load_prefs.php");
 
 
    include("../src/load_prefs.php");
 
-   echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
-   displayPageHeader($color, "None");
-
    // This function is used when not sending or adding attachments
    function newMail () {
       global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, $body,
    // This function is used when not sending or adding attachments
    function newMail () {
       global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, $body,
    if(isset($send)) {
       if (checkInput()) {
          sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body);
    if(isset($send)) {
       if (checkInput()) {
          sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body);
-         showSentForm();
+         header ("Location: right_main.php");
       } else {
       } else {
+         echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+         $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
+         displayPageHeader($color, "None");
+
          showInputForm();
       }
    } else if (isset($attach)) {
          showInputForm();
       }
    } else if (isset($attach)) {
+      echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+      $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
+      displayPageHeader($color, "None");
+
       $localfilename = md5("$attachfile, $attachfile_name, $REMOTE_IP, $REMOTE_PORT, $UNIQUE_ID, and everything else that may add entropy");
       $localfilename = $localfilename;
       
       $localfilename = md5("$attachfile, $attachfile_name, $REMOTE_IP, $REMOTE_PORT, $UNIQUE_ID, and everything else that may add entropy");
       $localfilename = $localfilename;
       
       
       showInputForm();
    } else if (isset($do_delete)) {
       
       showInputForm();
    } else if (isset($do_delete)) {
+      echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+      $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
+      displayPageHeader($color, "None");
+
       while (list($key, $localname) = each($delete)) {
          array_splice ($attachments, $key, 1);
          unlink ($attachment_dir.$localname);
       while (list($key, $localname) = each($delete)) {
          array_splice ($attachments, $key, 1);
          unlink ($attachment_dir.$localname);
 
       showInputForm();
    } else {
 
       showInputForm();
    } else {
+      echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+      $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
+      displayPageHeader($color, "None");
+
       $newmail = true;
       newMail();
       showInputForm();
       $newmail = true;
       newMail();
       showInputForm();