From 41f35f172ddbb48227ea85f6d4065466f2195e91 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 17 Jan 2012 17:31:42 +0000 Subject: [PATCH] Fixes odd premature end of headers issue --- classes/woocommerce_email.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/woocommerce_email.class.php b/classes/woocommerce_email.class.php index 3fbc0454ff8..8291512d42e 100644 --- a/classes/woocommerce_email.class.php +++ b/classes/woocommerce_email.class.php @@ -96,9 +96,12 @@ class woocommerce_email { add_filter( 'wp_mail_from_name', array(&$this, 'get_from_name') ); add_filter( 'wp_mail_content_type', array(&$this, 'get_content_type') ); - // Send the mail + ob_start(); + wp_mail( $to, $subject, $message, $headers, $attachments ); + ob_end_clean(); + // Unhook remove_filter( 'wp_mail_from', array(&$this, 'get_from_address') ); remove_filter( 'wp_mail_from_name', array(&$this, 'get_from_name') );