'; } add_action('admin_head', 'stats_function'); } $multisite_enabled = "false";// enables Easiest Newsletter to work on a WordPress Multisite install, false by default add_option("newsletter_from_name", "nothing"); add_option("newsletter_from_email", "nothing"); add_option("newsletter_from_subject", "nothing"); add_option("newsletter", "nothing"); function removesmartquotes($content) { $content = str_replace('“', '"', $content); $content = str_replace('”', '"', $content); $content = str_replace('‘', ''', $content); $content = str_replace('’', ''', $content); return $content; } function alex_newsletter_head_html(){ ?> '; if (isset($_REQUEST['newsletter_content'])) { if($_POST['sendto']==1){//users update_option("newsletter_from_name", $_REQUEST['newsletter_from_name']); update_option("newsletter_from_email", $_REQUEST['newsletter_from_email']); update_option("newsletter_from_subject", $_REQUEST['newsletter_from_subject']); update_option("newsletter", $_REQUEST['newsletter_content']); global $wpdb; $wp_user_search = $wpdb->get_results("SELECT user_email FROM $wpdb->users ORDER BY ID"); foreach ( $wp_user_search as $userid ) { $newsletter_content = stripslashes($_REQUEST['newsletter_content']); $newsletter_from_name = $_REQUEST['newsletter_from_name']; $newsletter_from_email = $_REQUEST['newsletter_from_email']; $newsletter_from_subject = $_REQUEST['newsletter_from_subject']; //add_filter('wp_mail_content_type',create_function('', 'return "text/html"; ')); $headers = array('From: ' . $newsletter_from_name . ' <' . $newsletter_from_email . '>', "Content-Type: text/html" ); $h = implode("\r\n",$headers) . "\r\n"; wp_mail($userid->user_email, $newsletter_from_subject,$newsletter_content, $headers); } echo "