Skip to content

boolean_smtp_mail_validate

Filters whether a message should be rejected before it is processed further.

filter Tier A Since 1.0.0

Return an error object (see {@see \BooleanSmtp\Adapters\Contracts\ErrorHandlerAdapterContract}) to reject the message and fail the send; return null to let it continue.

Signature

add_filter( 'boolean_smtp_mail_validate', $callback, 10, 2 );

Parameters

ParameterTypeDescription
$validationmixedNull to continue, or an error object naming the rejection reason.
$attsarray<string, mixed>wp_mail-style arguments being validated.

Returns mixed — A `WP_Error` to reject the message, `true` to accept it, or `null` to run the built-in validation.

Fires in

Example

boolean_smtp_mail_validate.php
add_filter( 'boolean_smtp_mail_validate', function ( $validation, array $atts ) {
return $validation;
}, 10, 2 );

Next steps