Magento 2 Check Email id exist or not at website level.

Magento 2 handle the email address at the Global and Website level.

You can set global or website level for email id from Stores -> Configuration -> Customer -> Customer Configuration -> Account Sharing Options

Choose Share Customer Accounts Global or Website level.

If you have kept Website level, you need to create a separate account for different website in a single Magento instance.

You can check the email id exist or not for a specific website by below code snippet.

<?php
namespace Path\To\Model;

use Magento\Customer\Api\AccountManagementInterface;
use Magento\Store\Model\StoreManagerInterface;

class EmailCheck {
    /**
     * @var AccountManagementInterface
     */
    protected $customerAccountManagement;

    /**
     * @var StoreManagerInterface
     */
    protected $storeManager;

    /**
     * Data constructor.
     *
     * @param AccountManagementInterface $customerAccountManagement
     * @param StoreManagerInterface $storeManager
     */
    public function __construct(
        AccountManagementInterface $customerAccountManagement,
        StoreManagerInterface $storeManager,
    ) {
        $this->customerAccountManagement = $customerAccountManagement;
        $this->storeManager = $storeManager;
    }

    /**
     *
     * @return bool
     */
    public function emailExistOrNot(): bool
    {
        $email = "rakesh_jesadiya@exmaple.com";
        $websiteId = (int)$this->storeManager->getWebsite()->getId();
        $isEmailNotExists = $this->customerAccountManagement->isEmailAvailable($email, $websiteId);
        return $isEmailNotExists;
    }
}

A response will be boolean.

If email does not exist return the result as true otherwise return false;