Hey sachin87,
if you’re on WP2.7, check /wp-includes/pluggable.php lines 354 and 976
To change the send name (rather than address) change line 343 from:
$from_name = ‘WordPress’;
to:
$from_name = get_option(‘blogname’);
why not just plug it?
<?php
/*
Plugin Name: Change Email From Address/Name
Plugin URI: http://rathercurious.net
Description: changes the email from address
Version: 0.1.0
Author: Justin Adie
Author URI: http://rathercurious.net
*/
class emailFrom{
public function __construct(){
add_filter('wp_mail_from', array(&$this, 'doEmailFilter'),10, 1);
add_filter('wp_mail_from_name', array(&$this, 'doEmailNameFilter'), 10, 1);
}
public function doEmailFilter($data){
return 'address@domain.com';
}
public function doEmailNameFilter($data){
return 'My Name';
}
}
$_ef = new emailFrom();
?>
the annoyance that i have is that ampersands seem to come through as their literal html equivalent and the various email clients that i have (apple MAIL and Entourage) do not seem to translate back into html characters (at least in the subject). this can also be plugged if you want. add this filter to the constructor
add_filter('wp_mail', array(&$this, 'decode'), 10,1);
and add this method to the class
public function decode($array){
$array['subject'] = html_entity_decode($array['subject']);
return $array;
}
I have this problem too. However, if I update wordpress, won’t I have to go back into the code?