Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My wordpress settings email is contact@domain.com. When I search my entire database for the email of wordpress@domain.com, it does not exist.

Yet my registration emails are still sent from wordpress@domain.com for some reason.

The only thing I can think of is that when I look in my wp_users table, I have no user with the ID of 1. I believe this is the default admin ID. I'm not sure who did it or when, but I think the default admin was deleted a long time ago and I just made my username admin. Perhaps if wordpress doesn't find an admin email, it automatically goes to wordpress@?

I'm confused with this one.

share|improve this question

2 Answers 2

Ok, then you can try this You can set the header, just not with a parameter. WordPress uses "hooks" and the hooks you need are 'wp_mail_from' and 'wp_mail_from_name' hooks.

Here are the hooks you might add to your theme's functions.php file to modify the "From:" header when using wp_mail() to the email address Greg j :

add_filter('wp_mail_from','yoursite_wp_mail_from');
function yoursite_wp_mail_from($content_type) {
  return 'abc@example.com';
}
add_filter('wp_mail_from_name','yoursite_wp_mail_from_name');
function yoursite_wp_mail_from_name($name) {
  return 'Greg j';
}
share|improve this answer

WordPress does not look at your admin email, it uses the made-up address, each time wp_mail() was called without a From header.

// From email and name
// If we don't have a name from the input headers
if ( !isset( $from_name ) )
    $from_name = 'WordPress';

/* If we don't have an email from the input headers default to wordpress@$sitename
 * Some hosts will block outgoing mail from this address if it doesn't exist but
 * there's no easy alternative. Defaulting to admin_email might appear to be another
 * option but some hosts may refuse to relay mail from an unknown domain. See
 * http://trac.wordpress.org/ticket/5007.
 */

if ( !isset( $from_email ) ) {
    // Get the site domain and get rid of www.
    $sitename = strtolower( $_SERVER['SERVER_NAME'] );
    if ( substr( $sitename, 0, 4 ) == 'www.' ) {
        $sitename = substr( $sitename, 4 );
    }

    $from_email = 'wordpress@' . $sitename;
}

You can filter that from address and the name: changing notification emails from WordPress <wordpress>@mydomain.net to something else

In some cases you must filter it: when your domain name is www.tld, WordPress will strip the www. and use an email address wordpress@tld.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.