Execute("SELECT customers_firstname, customers_lastname, customers_email_address FROM " . $oostable['customers']);
$mail_sent_to = TEXT_ALL_CUSTOMERS;
break;
/* toto Newsletter
case '**D':
$mail_result = $dbconn->Execute("SELECT customers_firstname, customers_lastname, customers_email_address FROM " . $oostable['customers'] . " WHERE customers_newsletter = '1'");
$mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
break;
*/
default:
$customers_email_address = oos_db_prepare_input($_POST['customers_email_address']);
$mail_result = $dbconn->Execute("SELECT customers_firstname, customers_lastname, customers_email_address FROM " . $oostable['customers'] . " WHERE customers_email_address = '" . oos_db_input($customers_email_address) . "'");
$mail_sent_to = oos_db_prepare_input($_POST['customers_email_address']);
break;
}
// Instantiate a new mail object
$send_mail = new PHPMailer();
$send_mail->PluginDir = OOS_ABSOLUTE_PATH . 'includes/lib/phpmailer/';
$sLang = (isset($_SESSION['iso_639_1']) ? $_SESSION['iso_639_1'] : 'en');
$send_mail->SetLanguage( $sLang, OOS_ABSOLUTE_PATH . 'includes/lib/phpmailer/language/' );
$send_mail->CharSet = CHARSET;
$send_mail->IsMail();
$send_mail->From = $from_mail ? $from_mail : STORE_OWNER_EMAIL_ADDRESS;
$send_mail->FromName = $from_name ? $from_name : STORE_OWNER;
$send_mail->Mailer = EMAIL_TRANSPORT;
// Add smtp values if needed
if ( EMAIL_TRANSPORT == 'smtp' ) {
$send_mail->IsSMTP(); // set mailer to use SMTP
$send_mail->SMTPAuth = OOS_SMTPAUTH; // turn on SMTP authentication
$send_mail->Username = OOS_SMTPUSER; // SMTP username
$send_mail->Password = OOS_SMTPPASS; // SMTP password
$send_mail->Host = OOS_SMTPHOST; // specify main and backup server
} else
// Set sendmail path
if ( EMAIL_TRANSPORT == 'sendmail' ) {
if (!oos_empty(OOS_SENDMAIL)) {
$send_mail->Sendmail = OOS_SENDMAIL;
$send_mail->IsSendmail();
}
}
$send_mail->Subject = $subject;
while ($mail = $mail_result->fields) {
$send_mail->Body = $message;
$send_mail->AddAddress($mail['customers_email_address'], $mail['customers_firstname'] . ' ' . $mail['customers_lastname']);
$send_mail->Send();
$send_mail->ClearAddresses();
$send_mail->ClearAttachments();
// Move that ADOdb pointer!
$mail_result->MoveNext();
}
oos_redirect_admin(oos_href_link_admin($aContents['mail'], 'mail_sent_to=' . urlencode($mail_sent_to)));
}
if ( ($action == 'preview') && !isset($_POST['customers_email_address']) ) {
$messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
}
if (isset($_GET['mail_sent_to'])) {
$messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $_GET['mail_sent_to']), 'notice');
}
require 'includes/header.php';
?>
-
' . HEADER_TITLE_TOP . ''; ?>
-
' . BOX_HEADING_TOOLS . ''; ?>
-
|
|
|
|
|
|
|
|
|
|
$value) {
if (!is_array($_POST[$key])) {
echo oos_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
}
}
?>
|
' . BUTTON_CANCEL . '' . oos_submit_button(IMAGE_SEND_EMAIL); ?> |
|
|
|
'', 'text' => TEXT_SELECT_CUSTOMER);
$customers[] = array('id' => '***', 'text' => TEXT_ALL_CUSTOMERS);
$customers[] = array('id' => '**D', 'text' => TEXT_NEWSLETTER_CUSTOMERS);
$mail_result = $dbconn->Execute("SELECT customers_email_address, customers_firstname, customers_lastname FROM " . $oostable['customers'] . " ORDER BY customers_lastname");
while($customers_values = $mail_result->fields) {
$customers[] = array('id' => $customers_values['customers_email_address'],
'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
// Move that ADOdb pointer!
$mail_result->MoveNext();
}
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|