Re-arranged where wp-mail() sets message headers

git-svn-id: https://develop.svn.wordpress.org/trunk@1775 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Donncha O Caoimh 2004-10-11 12:04:37 +00:00
parent 18585460f5
commit 24359ab0fb
1 changed files with 4 additions and 7 deletions

View File

@ -1876,16 +1876,13 @@ function htmlentities2($myHTML) {
function wp_mail($to, $subject, $message, $headers = '', $more = '') { function wp_mail($to, $subject, $message, $headers = '', $more = '') {
if ( function_exists('mb_send_mail') ) if( $headers == '' ) {
{
if( $headers == '' )
{
$headers = "MIME-Version: 1.0\r\n" . $headers = "MIME-Version: 1.0\r\n" .
"From: " . $to . " <" . $to . ">\r\n" . "From: " . $to . " <" . $to . ">\r\n" .
"Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n"; "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n";
}
return mb_send_mail($to, $subject, $message, $headers, $more);
} }
if ( function_exists('mb_send_mail') )
return mb_send_mail($to, $subject, $message, $headers, $more);
else else
return mail($to, $subject, $message, $headers, $more); return mail($to, $subject, $message, $headers, $more);
} }
@ -1917,4 +1914,4 @@ function wp_login($username, $password, $already_md5 = false) {
} }
} }
?> ?>