How to check email exist WordPress

I create custom filed in checkout page in woocommerce to add Reagent user email:

add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' );

function my_custom_checkout_field( $checkout ) {


    woocommerce_form_field( 'my_field_name', array(
        'type'          => 'text',
        'class'         => array('my-field-class form-row-wide'),
        'label'         => __('ایمیل معرف'),
        'placeholder'   => __('ایمیل معرف خود را وارد کنید'),
        ), $checkout->get_value( 'my_field_name' ));

    echo '</div>';
    return $checkout;


}

So now i want get error if the Reagent user email not exist.

Read More

i using the code:

add_filter('my_custom_checkout_field', 'yourprefix_process_myaccount_address_fields' );

function yourprefix_process_myaccount_address_fields( $checkout ) {
     $exists = email_exists($checkout);
  if ( $exists )
    echo "That E-mail is registered to user number" . $exists;
  else
        wc_add_notice( __( 'Email not exist', 'woocommerce' ), 'error' );
    }
}

but the code not working and not get any errror…
so how can do it?

Related posts