• Resolved Lukasz

    (@wpfed)


    Hi,

    In processor.php there is is_email_callback( $email ) which uses ‘is_email’ to validate emails, but I need to use my own custom email validation. What would be best way to do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Patrick

    (@paddyam)

    Hi @wpfed,

    Thanks for reaching out! If you’d like to override the default is_email_callback and use a custom one, you can do so with the following snippet:

    // Add custom email address validator for WP Mail SMTP - Other SMTP mailer.
    add_action( 'init', function () {

    if ( class_exists( 'WPMailSMTP\MailCatcherV6' ) ) {
    \WPMailSMTP\MailCatcherV6::$validator = function ( $email ) {

    return is_email( $email );
    };
    }
    } );

    This will allow you to define your own callback logic instead of relying on the default.

    Thanks again for your question!

    Thread Starter Lukasz

    (@wpfed)

    Thank you @paddyam, that worked perfectly! I appreciate the great support.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.