Emails from WordPress

When my emails get sent out to Affiliates it comes from WordPress@mywebsite.com

How can I change that to be from a different email address and not wordpress?

Thanks,

Jo

One Response to Emails from WordPress

  1. George August 1, 2018 at 9:41 am #

    Hi Jo,

    The mail from address and name are within the core functionality of WordPress but you can modify them with two snippets.

    add_filter( 'wp_mail_from', 'example_wp_mail_from' );
    function example_wp_mail_from( $original_email_address ) {
    //Make sure the email is from the same domain
    //as your website to avoid being marked as spam.
    return 'webmaster@mydomainname.com';
    }


    add_filter( 'wp_mail_from_name', 'example_wp_mail_from_name' );
    function example_wp_mail_from_name( $original_email_from ) {
    return 'My Awesome Website';
    }

    Both these snippets should be placed in the functions.php file of your active theme. Also, don’t forget to use your email address and the preferred name you like to appear in your outgoing emails.

    Kind regards,
    George

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share