Support » Everything else WordPress » Admin email help

  • I searched for this but couldn’t find anything more recent than a year and a half ago, and it didn’t seem to apply to now.

    How can you change the address WP emails from? IE when I get an email saying someone replied to a topic, it comes from the default account on my server, and I’d like to change that if possible.

    Any suggestions?

Viewing 15 replies - 1 through 15 (of 18 total)
  • Nobody knows anything?

    This seems fairly easy, although perhaps unusual. Somebody’s got to know something….

    Admin>users – look in the BIG box on the right that says “contact info” – first line is your email address.

    The change you need to make is in the file pluggable-functions.php in your /wp-includes/ folder.

    Trent

    The change you need to make is in the file pluggable-functions.php in your /wp-includes/ folder.

    Truly? Because I’ve never had to do that – all I’ve ever done is change my email address in the settings.

    If you want to add an address that the admin emails come from yes, if you just want to change the address that the emails actually arive at no.

    Trent

    Example, the user will be sent an email from wordpress@mydomain.com unless I change this in that file:

    if ( !function_exists('wp_mail') ) :
    function wp_mail($to, $subject, $message, $headers = '') {
    if( $headers == '' ) {
    $headers = "MIME-Version: 1.0n" .
    "From: wordpress@" . preg_replace('#^www.#', '', strtolower($_SERVER['SERVER_NAME'])) . "n" .
    "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"n";
    }

    Unless I am missing something….(which is possible)

    Trent

    Huh. Guess I never noticed that before. I’ll go put my dollar in the jar now! 🙂

    I could be wrong about this as well because I really haven’t tested it, but it makes sense, so hold onto that dollar for now 😉

    Trent

    I think you’re on the right track, Trent.

    Most people have told me what doodlebee said, but I’m not missing anything that obvious. But I can’t figure out how to get it configured right. Something’s not right, because spam karma emails from the right addy, but wp itself emails from my hosting username @ the box I’m on at hosting dot com.

    Heck if I know.

    Thanks!

    I got an email from my site today, and by God, Trent, you’re right – it emails me from wordpress @ mydomainname. com (trying to make this *not* link…) I never noticed that before! Nice tip – whodathunkit? I’ll have to file that away in my “cool things to know” drawer 🙂

    I wish I knew why mine didn’t do that.

    And I’ve never had it do that on either server/host I’ve used.

    Interesting.

    Hi,

    Thank you very much for this post Trent it have help me configuring mine !

    PS : For those who have a several domain and wouldn’t that appear the defaut one use the line like this :

    if( $headers == ” ) {
    $headers = “MIME-Version: 1.0n” .
    “From: info @ planet-sansfil.com” . “\n” .
    annd it will show only the email you have inserted.

    Cya.

    There’s a couple conflicting things going on here. First, wp_mail explicitly hardcodes ‘wordpress’ @ yourservername.tld in the _header_ of the email, that’s the outside envelope, but not necessarily what the recipient will see.

    function wp_mail($to, $subject, $message, $headers = ”) {
    if( $headers == ” ) {
    $headers = “MIME-Version: 1.0\n” .
    “From: ” . get_settings(‘admin_email’) . “\n” .
    “Content-Type: text/plain; charset=\”” . get_settings(‘blog_charset’) . “\”\n”;
    # was: “From: wordpress@” . preg_replace(‘#^www\.#’, ”, strtolower($_SERVER[‘SERVER_NAME’])) . “\n” .
    }

    return @mail($to, $subject, $message, $headers);
    }

    The second problem is PHP’s tendency to send mail with a “Return-Path” setting of ‘apache@example.com’ or whatever the name of your name server is. You can fix that with the fix described here:

    http://drupal.org/project/returnpath

    You might be able to override this for multiple named-hosts on a server with php_value settings for each host configuration file, but I haven’t tried that.

    There’s a good chance that all of this will be moot if you upgrade to the 2.2 version.

    knoxjon, where are you seeing the resulting address?

    I’m curious because I use the WP-GotLucky plugin (it emails me when my site is Top in Google). I recently changed servers and noticed the plugin now emails me from USERNAME @ HOST and I don’t like it, I would rather it uses my Domain name instead of an unsightly Host server address for the domain. However, I’m thinking this is coded in the Plugin. It isn’t using my Admin email, which is my Gmail account and not associated to the host name or domain.

    The only place I can think of that uses the hardcoded wordpress@ address, is the Password/Confirm email you get when you register or click Lost Password. This also doesn’t use the Admin Contact email, AFIK. I’m going to have to test that on my new server and see what the addy is.

    In 2.1.3, the file you need to change is /wp-includes/pluggable.php

    In addition to changing the “From” line as indicated above, check for the variable $wp_email, which is set to wordpress@

    Also, if a plugin is generating the undesired from address, check all the files for “wordpress@”. I found 4 occurrences in cforms2.

    Use an editor like Notepad++ to do a “find all in all files” to make your life a little easier.

    HTH 🙂

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Admin email help’ is closed to new replies.