Title: Stops working with multiple admin emails.
Last modified: November 15, 2017

---

# Stops working with multiple admin emails.

 *  Resolved [terry789](https://wordpress.org/support/users/terry789/)
 * (@terry789)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/)
 * Hello Vinny,
 * another question, it stops working when there are multiple admin emails.
 * No more notifications will be sent. I also use BuddyPress.
 * Tried this plugin [https://wordpress.org/plugins/multiple-admin-email-addresses/](https://wordpress.org/plugins/multiple-admin-email-addresses/)
 * Installed only everything works but if I add an admin email it stops working.
 * More brilliant knowledge?
 * Thanks

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [useStrict](https://wordpress.org/support/users/usestrict/)
 * (@usestrict)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/#post-9686046)
 * Sorry, but I don’t understand what you mean. The plugin will fetch all users 
   that are supposed to receive the emails and then grab their email addresses and
   add to a unique list (so people don’t get duplicated emails).
 * Are you saying that with [https://wordpress.org/plugins/multiple-admin-email-addresses/](https://wordpress.org/plugins/multiple-admin-email-addresses/)
   active bbpnns no longer works?
 *  Thread Starter [terry789](https://wordpress.org/support/users/terry789/)
 * (@terry789)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/#post-9686134)
 * When I have an extra admin email address under Settings – General – Email address
   separated by a comma it stops working.
 * **Not if only that plugin is installed and active** but only when I add an email
   address as admin email. See screenshot [https://prnt.sc/havc4k](https://prnt.sc/havc4k)
 *  Plugin Author [useStrict](https://wordpress.org/support/users/usestrict/)
 * (@usestrict)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/#post-9686174)
 * I haven’t tested to be sure, but that’s probably because the plugin uses that
   field to set the From email header
 *     ```
       $headers = array( sprintf( "From: %s <%s>", get_option( 'blogname' ), get_bloginfo( 'admin_email' ) ) );
       ```
   
 * WordPress does not expect Settings – General – Email address to have multiple
   addresses separated by commas.
 * However, if you really want to use those multiple emails, you’ll have to hook
   into the headers filter and fix the From header. the filter is `bbpnns_extra_headers`
   and it’s called like so:
 *     ```
       $headers = apply_filters( 'bbpnns_extra_headers', $headers, $recipients, $subject, $body );
       ```
   
 * I hope this helps.
 *  Thread Starter [terry789](https://wordpress.org/support/users/terry789/)
 * (@terry789)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/#post-9686183)
 * Where and how could I use this? Can this be in my functions.php? If so, what 
   is the exact code?
 *  Plugin Author [useStrict](https://wordpress.org/support/users/usestrict/)
 * (@usestrict)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/#post-9686281)
 * In `functions.php`:
 *     ```
       /**
        * Make bbpnns select the first email address when admin email field contains multiple
        * addresses separated by commas.
        */
       function my_adjust_bbpnns_from_header( $headers, $recipients=array(), $subject='', $body='' ) 
       {
       	foreach ( $headers as &$h )
       	{
       		if ( 'From:' === substr( $h, 0, strlen('From:') ) && preg_match( '/<.*,.*>/', $h ) )
       		{
       			$h = preg_replace( '/<([^>,]+)?,[^>]+>/', '<$1>', $h );
       		}
       	}
   
       	return $headers;
       }
   
       add_filter( 'bbpnns_extra_headers', 'my_adjust_bbpnns_from_header', 10, 4 );
       ```
   
 * Cheers,
    Vinny
 *  Thread Starter [terry789](https://wordpress.org/support/users/terry789/)
 * (@terry789)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/#post-9686415)
 * Thank you Vinny,
 * Works perfect now!
 * See my five star review!
 *  Plugin Author [useStrict](https://wordpress.org/support/users/usestrict/)
 * (@usestrict)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/#post-9686431)
 * I saw it, thank you very much!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Stops working with multiple admin emails.’ is closed to new replies.

 * ![](https://ps.w.org/bbpress-notify-nospam/assets/icon-256x256.png?rev=3449133)
 * [bbPress Notify (No-Spam)](https://wordpress.org/plugins/bbpress-notify-nospam/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bbpress-notify-nospam/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bbpress-notify-nospam/)
 * [Active Topics](https://wordpress.org/support/plugin/bbpress-notify-nospam/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bbpress-notify-nospam/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bbpress-notify-nospam/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [useStrict](https://wordpress.org/support/users/usestrict/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/stops-working-with-multiple-admin-emails/#post-9686431)
 * Status: resolved