Support » Fixing WordPress » Problem with e-mail sender name

  • Hello everybody. I’ve installed WordPress on my site and it’s working fine but I am having a problem with my mailing system. Whenever a new person registers on my site, he/she gets a mail with the sender name “WordPress”, I want to change it to “Admin” but I don’t know how to do it.So please help me.

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with e-mail sender name’ is closed to new replies.