Fires after a PHPMailer\PHPMailer\Exception is caught.
Parameters
Source
do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_data ) );
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |
Fires after a PHPMailer\PHPMailer\Exception is caught.
do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_data ) );
Version | Description |
---|---|
4.4.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
Debugging wp_mail() can be a lot easier with this simple method.
It will display a more helpful error message (the original phpmailer error) than WordPress will by default.
Just add this function to display the real wp_mail() error.
But only use this for debugging.