Added mark as read/unread functionality. Rearrange UI of right_main's grey action...
[squirrelmail.git] / functions / smtp.php
index b8969a11dc1a3c9ee93d289bb758e471cf5541d0..fd179db65baecbf0225982ee74d38bf5c4f5c08c 100644 (file)
@@ -11,7 +11,8 @@
       return;
    define('smtp_php', true);
 
-   include('../functions/addressbook.php');
+   require_once('../functions/addressbook.php');
+   require_once('../functions/plugin.php');
 
    global $username, $popuser, $domain;
 
    }
 
    function sendSMTP($t, $c, $b, $subject, $body, $more_headers) {
-      global $username, $popuser, $domain, $version, $smtpServerAddress, $smtpPort,
-         $data_dir, $color, $use_authenticated_smtp, $identity;
+      global $username, $popuser, $domain, $version, $smtpServerAddress, 
+         $smtpPort, $data_dir, $color, $use_authenticated_smtp, $identity, 
+        $key, $onetimepad;
 
       $to = expandAddrs(parseAddrs($t));
       $cc = expandAddrs(parseAddrs($c));
       if ($num != 250) {
          $tmp = nl2br(htmlspecialchars($tmp));
          displayPageHeader($color, 'None');
-         include ("../functions/display_messages.php");
+         include_once('../functions/display_messages.php');
          $msg  = "Message not sent!<br>\nReason given: $tmp";
          plain_error_message($msg, $color);
          return(0);
 
    function errorCheck($line, $smtpConnection, $verbose = false) {
       global $color;
-      include '../functions/page_header.php';
       
       // Read new lines on a multiline response
       $lines = $line;
       }
 
       if ($status == 0) {
+         include_once('../functions/page_header.php');
          displayPageHeader($color, 'None');
-                include ("../functions/display_messages.php");
+         include_once('../functions/display_messages.php');
          $lines = nl2br(htmlspecialchars($lines));
                 $msg  = $message . "<br>\nServer replied: $lines";
                 plain_error_message($msg, $color);
    function sendMessage($t, $c, $b, $subject, $body, $reply_id) {
       global $useSendmail, $msg_id, $is_reply, $mailbox, $onetimepad;
       global $data_dir, $username, $domain, $key, $version, $sent_folder, $imapServerAddress, $imapPort;
+      global $more_headers;
       $more_headers = Array();
 
+      do_hook("smtp_send");
+
       $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 1);
 
       if (isset($reply_id) && $reply_id) {
         
       return $length;
    }
-
-?>
+   
+?>
\ No newline at end of file