Hijack WP Mail

function catch_mail($stuff) {

//var_dump($stuff); 

$all_emails = explode(",", $stuff['to']);
  
                if (!empty($all_emails )) { foreach($all_emails as $to_email ) {
                
	                if (!empty($to_email)) { 
	
						$args['subject']    = $stuff['subject'];
						$args['from_email'] = "noreply@gatheringnow.org";
						$args['from_name']  = "noreply@gatheringnow.org";
						$args['content']    = $stuff['message']; 
						$args['to_email']   = $to_email; 
						$args['to_name']    = "";
						$args['rcpt']       = "noreply@gatheringnow.org";
					    
					    send_a_email( $args );
				    
				    }
			    
			    } }

}

add_filter('wp_mail', 'catch_mail' );
Comments