Execute($audience_select['query_string']); $mail_sent_to = $audience_select['query_name']; if ($_POST['email_to']) { $mail_sent_to = zen_db_prepare_input($_POST['email_to']); } // error message if no email address if (empty($mail_sent_to)) { $messageStack->add_session(ERROR_NO_CUSTOMER_SELECTED, 'error'); $_GET['action']=''; zen_redirect(zen_href_link(FILENAME_MAIL)); } $from = zen_db_prepare_input($_POST['from']); $subject = zen_db_prepare_input($_POST['subject']); $message = zen_db_prepare_input($_POST['message']); $html_msg['EMAIL_MESSAGE_HTML'] = zen_db_prepare_input($_POST['message_html']); $attachment_file = $_POST['attachment_file']; $attachment_fname = basename($_POST['attachment_file']); $attachment_filetype = $_POST['attachment_filetype']; // demo active test if (zen_admin_demo()) { $_GET['action']= ''; $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution'); zen_redirect(zen_href_link(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to))); } //send message using the zen email function //echo'EOF-attachments_list='.$attachment_file.'->'.$attachment_filetype; $recip_count=0; while (!$mail->EOF) { $html_msg['EMAIL_FIRST_NAME'] = $mail->fields['customers_firstname']; $html_msg['EMAIL_LAST_NAME'] = $mail->fields['customers_lastname']; zen_mail($mail->fields['customers_firstname'] . ' ' . $mail->fields['customers_lastname'], $mail->fields['customers_email_address'], $subject, $message, STORE_NAME, $from, $html_msg, 'direct_email', array('file' => $attachment_file, 'name' => basename($attachment_file), 'mime_type'=>$attachment_filetype) ); $recip_count++; $mail->MoveNext(); } if ($recip_count > 0) { $messageStack->add_session(sprintf(NOTICE_EMAIL_SENT_TO, $mail_sent_to . ' (' . $recip_count . ')'), 'success'); } else { $messageStack->add_session(sprintf(NOTICE_EMAIL_FAILED_SEND, $mail_sent_to . ' (' . $recip_count . ')'), 'error'); } zen_redirect(zen_href_link(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to) . '&recip_count='. $recip_count )); } if ( EMAIL_ATTACHMENTS_ENABLED && $action == 'preview') { // PROCESS UPLOAD ATTACHMENTS if (isset($_FILES['upload_file']) && zen_not_null($_FILES['upload_file']) && ($_POST['upload_file'] != 'none')) { if ($attachments_obj = new upload('upload_file')) { $attachments_obj->set_destination(DIR_WS_ADMIN_ATTACHMENTS . $_POST['attach_dir']); if ($attachments_obj->parse() && $attachments_obj->save()) { $attachment_file = $_POST['attach_dir'] . $attachments_obj->filename; $attachment_fname = $attachments_obj->filename; $attachment_filetype= $_FILES['upload_file']['type']; } } } //DEBUG: //$messageStack->add('EOF-attachments_list='.$attachment_file.'->'.$attachment_filetype, 'caution'); } //end attachments upload // error detection if ($action == 'preview') { if (!isset($_POST['customers_email_address']) ) { $messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error'); } if ( !$_POST['subject'] ) { $messageStack->add(ERROR_NO_SUBJECT, 'error'); } if ( !$_POST['message'] && !$_POST['message_html'] ) { $messageStack->add(ENTRY_NOTHING_TO_SEND, 'error'); } } ?> > <?php echo TITLE; ?>
'; ?>
   
         
      

'; ?>

','
'), "
\n", $message_preview); $message_preview = str_replace('

', "

\n", $message_preview); echo '' . nl2br(htmlspecialchars(stripslashes(strip_tags($message_preview))) ) . ''; ?>
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ' ' . zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?>
'', 'text' => "admin-attachments"); while ($file = $dir->read()) { if (is_dir(DIR_WS_ADMIN_ATTACHMENTS . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") { $dir_info[] = array('id' => $file . '/', 'text' => $file); } } $dir->close(); ?> '', 'text' => "(none)"); while ($file = $dir->read()) { if (is_file(DIR_WS_ADMIN_ATTACHMENTS . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") { $file_list[] = array('id' => $file , 'text' => $file); } } $dir->close(); ?>
Value = stripslashes($_POST['message_html']) ; $oFCKeditor->Width = '97%' ; $oFCKeditor->Height = '350' ; // $oFCKeditor->Create() ; $output = $oFCKeditor->CreateHtml() ; echo $output; } else { // using HTMLAREA or just raw "source" echo zen_draw_textarea_field('message_html', 'soft', '100%', '25', stripslashes($_POST['message_html']), 'id="message_html"'); } } ?>
' . stripslashes($_POST['upload_file']) . zen_draw_hidden_field('prev_upload_file', stripslashes( $_POST['upload_file']) ); ?>
 
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>