W3cubDocs

/WordPress

do_action( ‘wp_mail_failed’, WP_Error $error )

Fires after a PHPMailer\PHPMailer\Exception is caught.

Parameters

$errorWP_Error
A WP_Error object with the PHPMailerPHPMailerException message, and an array containing the mail recipient, subject, message, headers, and attachments.

Source

do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_data ) );

Changelog

Version Description
4.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_mail_failed