summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/compose.inc4
-rw-r--r--program/steps/mail/sendmail.inc16
2 files changed, 14 insertions, 6 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 30c9f79fb..b62f9bf5a 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -149,7 +149,9 @@ if ($font && !is_array($font)) {
}
// default font size for HTML editor
-$OUTPUT->set_env('default_font_size', $RCMAIL->config->get('default_font_size'));
+if ($font_size = $RCMAIL->config->get('default_font_size')) {
+ $OUTPUT->set_env('default_font_size', $font_size);
+}
// get reference message and set compose mode
if ($msg_uid = $COMPOSE['param']['draft_uid']) {
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 3f4475e46..dee8d2136 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -473,13 +473,19 @@ $isHtml = (bool) get_input_value('_is_html', RCUBE_INPUT_POST);
$message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset);
if ($isHtml) {
- $font_family = rcube_fontdefs($RCMAIL->config->get('default_font', 'Arial'));
- $font_size = $RCMAIL->config->get('default_font_size');
- $bstyle = ' style="font:' . $font_size . ' ' . $font_family . ';"';
+ $bstyle = array();
+
+ if ($font_size = $RCMAIL->config->get('default_font_size')) {
+ $bstyle[] = 'font-size: ' . $font_size;
+ }
+ if ($font_family = $RCMAIL->config->get('default_font')) {
+ $bstyle[] = 'font-family: ' . rcmail::font_defs($font_family);
+ }
// append doctype and html/body wrappers
- $message_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">' .
- "\r\n<html><body$bstyle>\r\n" . $message_body;
+ $message_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">'
+ . "\r\n<html><body" . (!empty($bstyle) ? " style='" . implode($bstyle, '; ') . "'" : '') . ">\r\n"
+ . $message_body;
}
if (!$savedraft) {