WordPress.org

Ready to get started?Download WordPress

Forums

wordpress@website.com (13 posts)

  1. denzel2364
    Member
    Posted 4 years ago #

    Hi there,

    I have changed admin, user details emails accounts but for some reason i had a bounce back which tried to email wordpress@mywebsite.com

    .........
    Your message did not reach some or all of the intended recipients.

    Subject: Re: [www.website.co.uk] Please moderate: "Title of blog"
    Sent: 22/04/2010 10:25

    The following recipient(s) cannot be reached:

    wordpress@website.co.uk on 22/04/2010 10:25

    The e-mail account does not exist at the organization this message was sent to. Check the e-mail address, or contact the recipient directly to find out the correct address.
    ..............

    Any ideas?

  2. Taylor Dewey
    Member
    Posted 4 years ago #

    You say you're emailing to wordpress@mywebsite.com, but your error message shows wordpress@website.co.uk

    In any case, email addresses are created on the server, not through WordPress.

  3. denzel2364
    Member
    Posted 4 years ago #

    soz, i just didnt want my website posted here:

    somewhere, it has a default emailing address of 'wordpress@'

    If i have set it up in the settings and in the 'admin' user why is it not working?

  4. Taylor Dewey
    Member
    Posted 4 years ago #

    So, to be clear, you've gone into the admin user's settings and specified an email address for example: theadminguy@example.com

    But WordPress is sending out emails to wordpress@example.com instead of using theadminguy@example.com

    Sound right?

  5. denzel2364
    Member
    Posted 4 years ago #

    Right, im getting a comment come through from the website and it says in the subject:

    WordPress [wordpress@website.co.uk]

    and when you press reply it says in the address bar:
    wordpress@website.co.uk

    Otherwise, its emailing to the correct email as specified in the admin settings

  6. Taylor Dewey
    Member
    Posted 4 years ago #

    Okay, I understand. It's actually expected behavior -- just went back and checked on some of my emails and they also come from wordpress@tddewey.com.

    I suppose there's probably a way to hook into and change the email address, but I don't see a particular reason to need to do so. To what purpose are you trying to email your blog back? Perhaps we can find a way around it.

  7. denzel2364
    Member
    Posted 4 years ago #

    Its because it is a commercial website. I dont want users to see wordpress. maybe 'noreply@'

    Thanks

  8. Taylor Dewey
    Member
    Posted 4 years ago #

    Gotcha. Looks like there's a filter already set-up for you called wp_mail_from.

    So, we can add a filter hook and modify the wp_mail_from if it's from wordpress@whatever as well as the wp_mail_from_name to be "noreply" or similar.

    This can be put in your theme's functions.php -- it was tested with WordPress 3.0b1 -- it should work on 2.9...

    function changedefaultemail($from_email) {
    	$sitename = strtolower( $_SERVER['SERVER_NAME'] );
    		if ( substr( $sitename, 0, 4 ) == 'www.' ) {
    			$sitename = substr( $sitename, 4 );
    		}
    
    	if (strtolower($from_email) == 'wordpress@'.$sitename) {
    		$from_email = 'noreply@'.$sitename;
    		return $from_email;
    	}
    }
    
    function changedefaultname ($wp_mail_from_name) {
    	if (strtolower($wp_mail_from_name) == 'wordpress') {
    		$wp_mail_from_name = 'noreply';
    		return $wp_mail_from_name;
    	 }
    }
    
    add_filter ( 'wp_mail_from', 'changedefaultemail' );
    add_filter ( 'wp_mail_from_name','changedefaultname');
  9. Taylor Dewey
    Member
    Posted 4 years ago #

    These functions of course, could be modified to get the site administrator's email address and use that instead.

  10. denzel2364
    Member
    Posted 4 years ago #

    Hi taylorde,

    Thank you for the code. However, i have had the following error:

    Warning: Cannot modify header information - headers already sent by (output started at xx/wp-content/themes/default/functions.php:864) in xx/wp-comments-post.php on line 82
    
    Warning: Cannot modify header information - headers already sent by (output started at xx/wp-content/themes/default/functions.php:864) in xx/wp-comments-post.php on line 83
    
    Warning: Cannot modify header information - headers already sent by (output started at xx/wp-content/themes/default/functions.php:864) in xx/wp-comments-post.php on line 84
    
    Warning: Cannot modify header information - headers already sent by (output started at xx/wp-content/themes/default/functions.php:864) in xx/wp-includes/pluggable.php on line 865

    Is this because the system i have installed isnt 2.9.2?

  11. Taylor Dewey
    Member
    Posted 4 years ago #

    You may have accidentally introduced a blank space into functions.php --- there cannot be anything outside of <?php and ?> including blank spaces or newlines (returns).

  12. denzel2364
    Member
    Posted 4 years ago #

    Thank you kindly.

    I will definately bookmark this article.

    Thank you for your help

  13. Taylor Dewey
    Member
    Posted 4 years ago #

    Glad it worked, you're welcome

Topic Closed

This topic has been closed to new replies.

About this Topic