Shop Forums WordPress Plugins Error with multiple admin mail

This topic contains 1 reply, has 2 voices, and was last updated by  vinny 3 weeks, 3 days ago.

  • Author
    Posts
  • #8164

    lorenzo
    Participant

    Hi,

    I set in my WP multiple admin mail. Now the mail address notification not stra with “Invalid Address (setFrom)”.

    How could I solve my issue?

    thank you

  • #8275

    vinny
    Keymaster

    Hi Lorenzo,

    Sorry for the delay. I didn’t see your message stuck in Pending status. You can try to use the following filter in your functions.php:

    function lorenzo_fix_multi_admin_email( $headers, $recipients, $subject, $body ) 
    {
    	foreach ( $headers as $i => $header )
    	{
    		if ( preg_match( "/^From:.*?<.*?,.*?>/", $header ) )
    		{
    			$headers[$i] = preg_replace("/<(.*?),[^>]+>/", "<$1>", $header );
    		}
    	}
    	
    	return $headers;
    }
    add_filter('bbpnns_extra_headers', 'lorenzo_fix_multi_admin_email', 10, 4);

You must be logged in to reply to this topic.