} else {
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
- global $smtpServerAddress, $smtpPort, $pop_before_smtp;
+ global $smtpServerAddress, $smtpPort, $pop_before_smtp, $pop_before_smtp_host;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
+ if (empty($pop_before_smtp_host)) $pop_before_smtp_host = $smtpServerAddress;
get_smtp_user($user, $pass);
$stream = $deliver->initStream($composeMessage,$domain,0,
- $smtpServerAddress, $smtpPort, $user, $pass, $authPop);
+ $smtpServerAddress, $smtpPort, $user, $pass, $authPop, $pop_before_smtp_host);
}
$success = false;
if ($stream) {
$success = $deliver->finalizeStream($stream);
}
if (!$success) {
- $msg = _("Message not sent.") . "<br />\n" .
+ $msg = _("Message not sent.") . "\n" .
$deliver->dlv_msg;
if (! empty($deliver->dlv_server_msg)) {
- $msg.= '<br />' .
+ $msg.= "\n" .
_("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' .
nl2br(htmlspecialchars($deliver->dlv_server_msg));
}
}
require_once(SM_PATH . 'class/deliver/Deliver_IMAP.class.php');
$imap_deliver = new Deliver_IMAP();
- $imap_deliver->mail($composeMessage, $imapConnection, 0, 0, $sent_folder);
+ $imap_deliver->mail($composeMessage, $imapConnection, 0, 0, $imapConnection, $sent_folder);
unset ($imap_deliver);
}
}
$a = array();
foreach ($recipients as $r) {
$a[] = array(
- 'Name' => htmlspecialchars($r->getAddress(false)),
+ // note: decodeHeader is htmlsafe by default
+ 'Name' => decodeHeader($r->getAddress(false)),
'Email' => htmlspecialchars($r->getEmail()),
- 'Full' => htmlspecialchars($r->getAddress(true))
+ 'Full' => decodeHeader($r->getAddress(true))
);
}
function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
global $base_uri, $where, $what, $show_html_default,
- $oTemplate, $download_href,
+ $oTemplate, $download_href, $PHP_SELF,
$unsafe_image_toggle_href, $unsafe_image_toggle_text;
$urlMailbox = urlencode($mailbox);
}
$url = $base_uri.'src/view_header.php?'.$query_string;
-
- // Build the printer friend link
- /* hackydiehack */
-
- // If there's no "view_unsafe_images" setting in the user's preferences,
- // turn unsafe images off by default.
- // FIXME: Check if the UIR plugin is enabled. If it's not, no unsafe images should be displayed regardless of the user's preferences. This test is done in several places in the code and they should all be fixed in the same way.
- if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
- $view_unsafe_images = false;
- } else {
- // FIXME: Do we really want to display the unsafe images regardless of the user's preferences?
- $view_unsafe_images = true;
- }
-
- $pf_params = '?passed_ent_id=' . $urlPassed_ent_id .
- '&mailbox=' . $urlMailbox .
- '&passed_id=' . $urlPassed_id .
- '&view_unsafe_images='. (bool) $view_unsafe_images .
- '&show_html_default=' . $show_html_default;
-
$links = array();
$links[] = array (
'URL' => $url,
'Text' => _("View Full Header")
);
- $links[] = array (
- 'URL' => $pf_params,
- 'Text' => _("View Printable Version")
+
+ if ( checkForJavaScript() ) {
+ $links[] = array (
+ 'URL' => 'javascript:printThis();',
+ 'Text' => _("Print"),
);
+ } else {
+ $links[] = array (
+ 'URL' => set_url_var($PHP_SELF, 'print', '1'),
+ 'Text' => _("Print"),
+ 'Target' => '_blank'
+ );
+ }
+
$links[] = array (
'URL' => $download_href,
'Text' => _("Download this as a file")
} else {
$view_unsafe_images = 0;
}
+
/**
* Retrieve mailbox cache
*/
/* End of block for handling incoming url vars */
/***********************************************/
+$oTemplate->assign('aAttribs', array('class' => 'entity_sep'));
+$hr = $oTemplate->fetch('horizontal_rule.tpl');
$messagebody = '';
do_hook('read_body_top', $null);
if ($show_html_default == 1) {
for ($i = 0; $i < $cnt; $i++) {
$messagebody .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox);
if ($i != $cnt-1) {
- $messagebody .= '<hr />';
+ $messagebody .= $hr;
}
}
$oTemplate->assign('message_list_href', get_message_list_uri($aMailbox['NAME'], $startMessage, $what));
displayPageHeader($color, $mailbox,'','');
-formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message,false);
+
+/* this is the non-javascript version of printer friendly */
+if ( sqgetGlobalVar('print', $print, SQ_GET) ) {
+ $oTemplate->display('read_message_print.tpl');
+} else {
+ formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message,false);
+}
formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee);
$oTemplate->assign('message_body', $messagebody);