How do I change notification emails address from WordPress @mydomain.net to something else.

I want to do this because WordPress @mydomain.net ends up getting flagged as junk mail.

Thanks

Daniel

link|improve this question
1  
Why not add the address to your safe senders list ? then it won't end up in the junk mail. – t31os Mar 18 '11 at 12:31
That would work for me but not my users. – user4030 Mar 19 '11 at 2:54
That's fair enough, it wasn't clear that you weren't only referring to yourself in the opening question. – t31os Mar 19 '11 at 9:13
feedback

3 Answers

I use a very similar approach like John P Bloch and Bainternet, just a little bit more flexible, so I don’t have to change the mail address for any client:

<?php # -*- coding: utf-8 -*-
/*
Plugin Name: Filter System From Mail
Description: Sets the WP from mail address to the first admin’s mail and the from name to blog name.
Version:     1.1
Author:      Thomas Scholz
Author URI:  http://toscho.de
License:     GPL
*/

if ( ! function_exists( 'filter_system_from_mail' ) )
{
    /**
     * First admin's e-mail address or blog name depending on current filter.
     *
     * @return string
     */
    function filter_system_from_mail()
    {
        return get_option( 'wp_mail_from' == current_filter()
            ? 'admin_email' : 'blogname' );
    }

    add_filter( 'wp_mail_from',      'filter_system_from_mail' );
    add_filter( 'wp_mail_from_name', 'filter_system_from_mail' );
}
link|improve this answer
4  
Very elegant solution. Nice! – John P Bloch Mar 21 '11 at 17:51
feedback

There's a great plugin that does this for you called Send From. However, if you want to roll this yourself, it's dead simple. To change the email address add a filter on 'wp_mail_from' like so:

function just_use_my_email(){
  return 'my.email@domain.com';
}

add_filter( 'wp_mail_from', 'just_use_my_email' );

And you can also change the sender's name using the 'wp_mail_from_name' filter like so (this is entirely optional):

function just_use_my_email_name(){
  return 'My Real Name';
}

add_filter( 'wp_mail_from_name', 'just_use_my_email_name' );

Just swap the fake values for your real email address and you're good to go.

link|improve this answer
feedback

here:

    //email from name function
function my_wp_mail_from_name($name) {
    return 'Name';
}

//email from email function
function my_wp_mail_from($content_type) {
  return 'email@Domain.com';
}

add_filter('wp_mail_from','my_wp_mail_from');
add_filter('wp_mail_from_name','my_wp_mail_from_name');

Change Name to the name you want and email@Domain.com to the email address you want. but if you change the email address most anti span filter will block or spam your mail for spoofing.

link|improve this answer
I used Send Form and it works as advertised. I also created an email address cas@mydomain.net and configured Send Form to be use it for automated site notifications. The test email I sent to my test user account was not flagged by the the spam filter. Success! Now I have to test with my users. Thanks! – user4030 Mar 19 '11 at 2:52
feedback

Your Answer

 
or
required, but never shown