diff -ur roundcubemail/program/include/main.inc /home/dok/Desktop/devel/roundcubemail/program/include/main.inc --- roundcubemail/program/include/main.inc 2006-03-23 23:32:32.000000000 +0100 +++ /home/dok/Desktop/devel/roundcubemail/program/include/main.inc 2006-04-29 23:06:48.000000000 +0200 @@ -314,6 +314,7 @@ $OUTPUT->add_script($javascript); $OUTPUT->include_script('program/js/common.js'); $OUTPUT->include_script('program/js/app.js'); + $OUTPUT->include_script('tinymce/jscripts/tiny_mce/tiny_mce.js'); // set locale setting rcmail_set_locale($sess_user_lang); @@ -1098,6 +1099,7 @@ 'composeattachmentform' => 'rcmail_compose_attachment_form', 'composeattachment' => 'rcmail_compose_attachment_field', 'priorityselector' => 'rcmail_priority_selector', + 'formatselector' => 'rcmail_format_selector', 'charsetselector' => 'rcmail_charset_selector', 'searchform' => 'rcmail_search_form', diff -ur roundcubemail/program/js/app.js /home/dok/Desktop/devel/roundcubemail/program/js/app.js --- roundcubemail/program/js/app.js 2006-03-27 21:07:13.000000000 +0200 +++ /home/dok/Desktop/devel/roundcubemail/program/js/app.js 2006-04-30 00:04:53.000000000 +0200 @@ -1655,7 +1655,8 @@ } // check for empty body - if (input_message.value=='') +// if (input_message.value=='') + if (tinyMCE.getContent()=='') { if (!confirm(this.get_label('nobodywarning'))) { diff -ur roundcubemail/program/steps/mail/compose.inc /home/dok/Desktop/devel/roundcubemail/program/steps/mail/compose.inc --- roundcubemail/program/steps/mail/compose.inc 2006-03-04 14:45:30.000000000 +0100 +++ /home/dok/Desktop/devel/roundcubemail/program/steps/mail/compose.inc 2006-04-30 00:58:45.000000000 +0200 @@ -555,6 +555,28 @@ } +function rcmail_format_selector($attrib) + { + list($form_start, $form_end) = get_form_tags($attrib); + unset($attrib['form']); + + $attrib['name'] = '_format'; + $selector = new select($attrib); + + $selector->add(array(rcube_label('HTML'), + rcube_label('TEXT')), + array(1, 0)); + + $sel = isset($_POST['_format']) ? $_POST['_format'] : 0; + + $out = $form_start ? "$form_start\n" : ''; + $out .= $selector->show($sel); + $out .= $form_end ? "\n$form_end" : ''; + + return $out; + } + + function get_form_tags($attrib) { global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $MESSAGE_FORM, $SESS_HIDDEN_FIELD; diff -ur roundcubemail/program/steps/mail/sendmail.inc /home/dok/Desktop/devel/roundcubemail/program/steps/mail/sendmail.inc --- roundcubemail/program/steps/mail/sendmail.inc 2006-03-23 23:32:43.000000000 +0100 +++ /home/dok/Desktop/devel/roundcubemail/program/steps/mail/sendmail.inc 2006-04-29 23:24:32.000000000 +0200 @@ -172,7 +172,10 @@ // create PEAR::Mail_mime instance $MAIL_MIME = new Mail_mime($header_delm); -$MAIL_MIME->setTXTBody($message_body, FALSE, TRUE); +if ((int)$_POST['_format']) + $MAIL_MIME->setHTMLBody($message_body, FALSE, TRUE); +else + $MAIL_MIME->setTXTBody($message_body, FALSE, TRUE); //$MAIL_MIME->setTXTBody(wordwrap($message_body), FALSE, TRUE); diff -ur roundcubemail/skins/default/templates/compose.html /home/dok/Desktop/devel/roundcubemail/skins/default/templates/compose.html --- roundcubemail/skins/default/templates/compose.html 2006-03-20 23:01:13.000000000 +0100 +++ /home/dok/Desktop/devel/roundcubemail/skins/default/templates/compose.html 2006-04-30 09:36:06.000000000 +0200 @@ -6,7 +6,6 @@ @@ -37,6 +48,10 @@