From e2c540b1ddbd54e6c518fccf8e6b9129fcdaeb6c Mon Sep 17 00:00:00 2001 From: Donncha O Caoimh Date: Fri, 8 Oct 2004 11:52:23 +0000 Subject: [PATCH] Define message header if blank. git-svn-id: https://develop.svn.wordpress.org/trunk@1760 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index eef24a7298..146cfa0ffb 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1871,7 +1871,15 @@ function htmlentities2($myHTML) { function wp_mail($to, $subject, $message, $headers = '', $more = '') { if ( function_exists('mb_send_mail') ) - return mb_send_mail($to, $subject, $message, $headers, $more); + { + if( $headers == '' ) + { + $headers = "MIME-Version: 1.0\r\n" . + "From: " . $to . " <" . $to . ">\r\n" . + "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n"; + } + return mb_send_mail($to, $subject, $message, $headers, $more); + } else return mail($to, $subject, $message, $headers, $more); }