public static function rac_send_test_mail() { $to = $_POST['rac_test_mail_to']; $plain_or_html = $_POST['rac_plain_or_html'] == '1' ? "plain" : "html"; $subject = "Test E-Mail"; $message = "This is a test E-Mail to Make sure E-Mail are sent successfully from your site."; if ($plain_or_html == 'html') { ob_start(); if (function_exists('wc_get_template')) { wc_get_template('emails/email-header.php', array('email_heading' => $subject)); echo $message; wc_get_template('emails/email-footer.php'); } else { woocommerce_get_template('emails/email-header.php', array('email_heading' => $subject)); echo $message; woocommerce_get_template('emails/email-footer.php'); } $message = ob_get_clean(); } else { $message = $message; } $headers = "MIME-Version: 1.0\r\n"; $headers .= FPRacCron::rac_formatted_from_address_woocommerce(); $headers .= "Reply-To: " . get_option('woocommerce_email_from_name') . " <" . get_option('woocommerce_email_from_address') . ">\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; if ('wp_mail' == get_option('rac_trouble_mail')) { if (FPRacCron::rac_send_wp_mail_test($to, $subject, $message, $headers)) { echo "sent"; } } else { if (FPRacCron::rac_send_mail_test($to, $subject, $message, $headers)) { echo "sent"; } } exit; }