• Hi!

    With the latest update (WordPress 4.7) my custom from email address is no longer working. All notification emails to users are now being sent from ‘[email protected]’ instead of ‘[email protected]’ as I set it with the following code in my functions.php

    //notification email address change
    add_filter('wp_mail_from','custom_email_from');
    function custom_email_from($mail) {
    $mail = '[email protected]'; // Replace the email address here //
    return $mail;
    }
    
    //notification name change
    add_filter('wp_mail_from_name','custom_email_from_name');
    function custom_email_from_name($name) {
    $name = get_bloginfo('My Site Name');//or put your own text here
    return $name;
    }

    I tried the following code too, which also did not work.

    /** changing default wordpres email settings */
     
    add_filter('wp_mail_from', 'new_mail_from');
    add_filter('wp_mail_from_name', 'new_mail_from_name');
     
    function new_mail_from($old) {
     return '[email protected]';
    }
    function new_mail_from_name($old) {
     return 'My Site Name';
    }

    Please help me restore my custom from email address.

    Thank you

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I have virtually identical code on my site and it still works fine after the 4.7 update, so it’s not that anything has changed in how this is supposed to work. Apparently some sort of conflict has developed unique to your site. We need to narrow down the cause of the conflict.

    Temporarily deactivate all of your plugins and switch to the twentysixteen theme. Add your code to the bottom of twentysixteen’s functions.php file. Do something that will trigger a notification email. The filtered from names should appear in the email that is sent out. If not, you may need to do a manual re-install of core files. Don’t use the re-install button on the updates admin screen, FTP the replacement files from a fresh WP download.

    If the filters are now working in twentysixteen, switch back to your normal theme and move the filter code to that theme’s functions.php. Retest the notification email. Activate plugins one by one, testing after each. When the filter code fails again, the last activated entity is causing the conflict. You can then take up the issue with the responsible author.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom from email stopped working’ is closed to new replies.