Code to Prevent WordPress from Sending Emails

/* Short-circuits the wp_mail() Function */
function wpflt_disable_email() {
    return false;
}
add_filter('pre_wp_mail', 'wpflt_disable_email');

If you want to prevent WordPress from sending any Emails, you can use the above code in your child theme’s functions.php.

Technically, this code will short-circuit the default wp_mail() function. The ‘pre_wp_mail‘ hook if used, replaces the wp_mail() function. This was introduced in WordPress 5.7.

You can also use the Plugin to disable Emails.