Home Forums WordPress Plugins Error with multiple admin mail

Viewing 1 reply thread
  • 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);
Viewing 1 reply thread
  • You must be logged in to reply to this topic.