Instead of WYSIWYG output, I am getting the following output when I create the E-mail, in OS Commerce.
<?php
/*
$Id: mail.php,v 1.31 2003/06/20 00:37:51 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
[url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]
Copyright © 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
if ( ($action == 'send_email_to_user') && isset($HTTP_POST_VARS['customers_email_address']) && !isset($HTTP_POST_VARS['back_x']) ) {
switch ($HTTP_POST_VARS['customers_email_address']) {
case '***':
$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS);
$mail_sent_to = TEXT_ALL_CUSTOMERS;
break;
case '**D':
$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
$mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
break;
default:
$customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']);
$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "'");
$mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
break;
}
$from = tep_db_prepare_input($HTTP_POST_VARS['from']);
$subject = tep_db_prepare_input($HTTP_POST_VARS['subject']);
$message = tep_db_prepare_input($HTTP_POST_VARS['message']);
//Let's build a message object using the email class
$mimemessage = new email(array('X-Mailer: osCommerce'));
// add the message to the object
$mimemessage->add_text($message);
$mimemessage->build_message();
while ($mail = tep_db_fetch_array($mail_query)) {
$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
}
tep_redirect(tep_href_link(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
}
if ( ($action == 'preview') && !isset($HTTP_POST_VARS['customers_email_address']) ) {
$messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
}
if (isset($HTTP_GET_VARS['mail_sent_to'])) {
$messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'success');
}?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<script language="javascript" type="text/javascript" src="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,save,autosave,autosave,cleanup,advhr,advimage,advlink,emotions,iespel
l,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,directionalit
y,inlinepopups,media,nonbreaking,visualchars,devkit,paste,noneditable,layer,fullp
age,fullscreen,",
theme_advanced_buttons1_add_before : "save,separator,",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,ltr,rtl",
theme_advanced_buttons4_add_before : "visualchars,nonbreaking,devkit,separator,layer,fullpage,fullscreen",
table_styles : "Header 1=header1;Header 2=header2;Header 3=header3",
table_cell_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Cell=tableCel1",
table_row_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",
table_cell_limit : 100,
table_row_limit : 5,
table_col_limit : 5,
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|v
space|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade
],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js"
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
Any ideas?
Nick in New Jersey