$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>";
$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) {
- $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 .= "$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");
- echo "a001 APPEND $sent_folder (\\Seen) \{$size}<br>";
$read_ary = sqimap_read_data ($imap_stream, "a001", true, $result, $message);
- for ($i = 0; $i < count($read_ary); $i++) {
- echo $read_ary[$i] . "<BR>";
- }
}
?>
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);
}
?>
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,
if(isset($send)) {
if (checkInput()) {
sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body);
- showSentForm();
+ header ("Location: right_main.php");
} 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)) {
+ 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;
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);
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();