wp_mail_failed WordPress Action Hook
The wp_mail_failed hook is triggered when there is an error sending an email using the WordPress mail function. This hook allows you to handle errors when email fails to send, so you can either log the error or display a message to the user.
do_action( 'wp_mail_failed', WP_Error $error ) #
Fires after a PHPMailer\PHPMailer\Exception is caught.