Ticket #2053: mailfrom.patch
| File mailfrom.patch, 2.7 kB (added by sjmurdoch, 2 years ago) |
|---|
-
wp-includes/pluggable-functions.php
old new 112 112 } 113 113 endif; 114 114 115 if ( !function_exists('wp_default_mailfrom') ) : 116 function wp_default_mailfrom() { 117 return get_settings('admin_email'); 118 } 119 endif; 120 115 121 if ( !function_exists('wp_mail') ) : 116 122 function wp_mail($to, $subject, $message, $headers = '') { 117 123 if( $headers == '' ) { 118 124 $headers = "MIME-Version: 1.0\n" . 119 "From: wordpress@" . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])) . "\n" .125 "From: " . wp_default_mailfrom() . "\n" . 120 126 "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n"; 121 127 } 122 128 … … 280 286 $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; 281 287 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 282 288 283 $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));289 $wp_email = wp_default_mailfrom(); 284 290 285 291 if ( '' == $comment->comment_author ) { 286 292 $from = "From: \"$blogname\" <$wp_email>"; -
wp-content/plugins/wp-db-backup.php
old new 639 639 $data = chunk_split(base64_encode($file)); 640 640 $headers = "MIME-Version: 1.0\n"; 641 641 $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"\n"; 642 $headers .= 'From: ' . get_settings('admin_email') . "\n";642 $headers .= 'From: ' . wp_default_mailfrom() . "\n"; 643 643 644 644 $message = sprintf(__("Attached to this email is\n %1s\n Size:%2s kilobytes\n"), $filename, round(filesize($diskfile)/1024)); 645 645 // Add a multipart boundary above the plain message -
wp-admin/install.php
old new 182 182 $admin_caps = serialize(array('administrator' => true)); 183 183 $wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES ({$wpdb->insert_id}, '{$table_prefix}capabilities', '{$admin_caps}');"); 184 184 185 $message_headers = 'From: ' . $weblog_title . ' < wordpress@' . $_SERVER['SERVER_NAME']. '>';185 $message_headers = 'From: ' . $weblog_title . ' <' . wp_default_mailfrom() . '>'; 186 186 $message = sprintf(__("Your new WordPress blog has been successfully set up at: 187 187 188 188 %1\$s
