Forums

Multiple admin email addresses (8 posts)

  1. chris13243
    Member
    Posted 5 months ago #

    Hi there,

    I've setup a Wordpress blog recently and its working fine. I have set two people as administrators of the blog but they are not receiving emails, e.g. new user registration.

    I have changed the email address in "Options" but is there a way I can specify two? If not, which file to I have to mod to get this to work? I can't find it!

    Thanks,
    Chris

  2. idlelimey
    Member
    Posted 4 months ago #

    seperate the addresses with a semi-colon. I haven't tested this method yet but should work (assume - makes an ass out of u and me - ass|u|me :) ).

    eg. some.one@123.com; some.one_else@123.com

  3. idlelimey
    Member
    Posted 4 months ago #

    scrub that last one. It didn't work. Sorry.

  4. clarkburbidge
    Member
    Posted 3 months ago #

    Anyone have any ideas on this? I'm interested in admin email going to two addresses.

  5. Otto42
    Moderator
    Posted 3 months ago #

    Separate them with a comma and a space.

    Like some.one@example.com, some.one_else@example.com

  6. Cortex
    Member
    Posted 1 month ago #

    I'm trying to do this as well. Separating them with a comma and a space does not work. Any other ideas?

  7. StrangeAttractor
    Member
    Posted 1 month ago #

    What I've done in the past is to set up a gmail account for the admin account. Have the gmail address forward the email to all the addresses you want.

    Obviously you could do this with other email services than gmail, and even your regular domain email server if it allows forwarding.

    Also, I use Dagon Design's Form Mailer, one of my favorite plugins, and well-supported and documented. This plugin allows multiple email addresses as recipients of contact forms, etc., so at least for those purposes it makes it easy to have multiple recipients.

  8. stonicus
    Member
    Posted 4 weeks ago #

    in wp-includes/formatting.php, function sanitize_option(), case 'admin_email', I made the following change:

    case 'admin_email':
    	$values = explode(",", $value);
    	foreach($values as $k=>$v)
    		$values[$k] = sanitize_email($v);
    	$value = implode(",", $values);
    	break;

    then, in wp-includes/pluggable.php, function wp_mail, I made the following change:

    function wp_mail( $targets, $subject, $message, $headers = '' )
    {
    	$tars = explode(",", $targets);
    	foreach($tars as $to)
    	{
    		// original function code here except for last return line
    	}
    	return $result
    }

    This allows commas between emails in the admin email setting, and ONLY the admin email setting, and the wp_mail function will mail whatever to every email separated by a comma. But, since as stated the admin_email is the only one we allow commas for, this is the only one that can receive this multiple-email functionality. We only return the $result of the attempt to send the last email. I don't think that will cause any problems though.

    This particular method requires a comma, and a comma only, between the email addresses. However, you could change the explode/implode functions to allow whatever delimiter you desire, just make sure to make it something that isn't valid in email addresses anyway, so you don't split up someone's valid email address.

Reply

You must log in to post.

About this Topic

Tags