diff --git a/wp-admin/users.php b/wp-admin/users.php index 003b64954..caee4a016 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -95,7 +95,7 @@ case 'adduser': $message = 'New user registration on your blog ' . get_settings('blogname') . ":\r\n\r\n"; $message .= "Login: $user_login\r\n\r\nE-mail: $user_email"; - @mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message); + @wp_mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message); header('Location: users.php'); break; diff --git a/wp-includes/functions.php b/wp-includes/functions.php index b6d6af16e..1793a02bf 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1003,7 +1003,7 @@ function wp_notify_postauthor($comment_id, $comment_type='comment') { . "$from\r\n" . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n"; - @mail($user->user_email, $subject, $notify_message, $message_headers); + @wp_mail($user->user_email, $subject, $notify_message, $message_headers); return true; } @@ -1046,7 +1046,7 @@ function wp_notify_moderator($comment_id) { . "$from\r\n" . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n"; - @mail($admin_email, $subject, $notify_message, $message_headers); + @wp_mail($admin_email, $subject, $notify_message, $message_headers); return true; } @@ -1796,4 +1796,12 @@ function htmlentities2($myHTML) { return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table)); } -?> + +function wp_mail($to, $subject, $message, $headers = '', $more = '') { + if ( function_exists('mb_send_mail') ) + return mb_send_mail($to, $subject, $message, $headers, $more); + else + return mail($to, $subject, $message, $headers, $more); +} + +?> \ No newline at end of file diff --git a/wp-login.php b/wp-login.php index d177e5dc5..5c04850c5 100644 --- a/wp-login.php +++ b/wp-login.php @@ -148,7 +148,7 @@ case 'retrievepassword': $message .= __('Password') . ": $user_pass\r\n"; $message .= get_settings('siteurl') . '/wp-login.php'; - $m = mail($user_email, sprintf(__("[%s] Your login and password"), get_settings('blogname')), $message); + $m = wp_mail($user_email, sprintf(__("[%s] Your login and password"), get_settings('blogname')), $message); if ($m == false) { echo '
' . __('The e-mail could not be sent.') . "
\n";
@@ -158,7 +158,7 @@ case 'retrievepassword':
echo '
' . sprintf(__("The e-mail was sent successfully to %s's e-mail address."), $user_login) . '
';
echo "" . __('Click here to login!') . '