exit;
}
$tmp = fgets($smtpConnection, 1024);
- if (errorCheck($tmp, $smtpConnection)!=5) return(0);
+ if (errorCheck($tmp, $smtpConnection)!=5) {
+ return(0);
+ }
$to_list = getLineOfAddrs($to);
$cc_list = getLineOfAddrs($cc);
$tmp = fgets($smtpConnection, 1024);
$num = errorCheck($tmp, $smtpConnection, true);
if ($num != 250) {
- $tmp = nl2br(htmlspecialchars($tmp));
- displayPageHeader($color, 'None');
- 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;
+ global $color, $compose_new_win;
/* Read new lines on a multiline response */
$lines = $line;
if ($status == 0) {
include_once('../functions/page_header.php');
- displayPageHeader($color, 'None');
+ if ($compose_new_win == '1') {
+ compose_Header($color, 'None');
+ }
+ else {
+ displayPageHeader($color, 'None');
+ }
include_once('../functions/display_messages.php');
$lines = nl2br(htmlspecialchars($lines));
$msg = $message . "<br>\nServer replied: $lines";
}
function createReceiptHeaders($receipt) {
-
- $receipt_headers = Array();
- $from_addr = getPref($data_dir, $username, 'email_address');
- $from = getPref($data_dir, $username, 'full_name');
-
- if ($from == '') {
- $from = "<$from_addr>";
- }
- else {
- $from = '"' . encodeHeader($from) . "\" <$from_addr>";
- }
-
- /* On Delivery */
- if ( $receipt == 1
- || $receipt == 3 ) {
- $receipt_headers["Return-Receipt-To"] = $from;
- }
- /* On Read */
- if ($receipt == 2
- || $receipt == 3 ) {
- /* Pegasus Mail */
- $receipt_headers["X-Confirm-Reading-To"] = $from;
- /* RFC 2298 */
- $receipt_headers["Disposition-Notification-To"] = $from;
- }
- return $receipt_headers;
-}
+
+ GLOBAL $data_dir, $username;
+
+ $receipt_headers = Array();
+ $from_addr = getPref($data_dir, $username, 'email_address');
+ $from = getPref($data_dir, $username, 'full_name');
+
+ if ($from == '') {
+ $from = "<$from_addr>";
+ }
+ else {
+ $from = '"' . encodeHeader($from) . "\" <$from_addr>";
+ }
+
+ /* On Delivery */
+ if ( $receipt == 1
+ || $receipt == 3 ) {
+ $receipt_headers["Return-Receipt-To"] = $from;
+ }
+ /* On Read */
+ if ($receipt == 2
+ || $receipt == 3 ) {
+ /* Pegasus Mail */
+ $receipt_headers["X-Confirm-Reading-To"] = $from;
+ /* RFC 2298 */
+ $receipt_headers["Disposition-Notification-To"] = $from;
+ }
+ return $receipt_headers;
+}
?>