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.


Parameters

$error

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


Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More