Please use below code in controller :
public function __construct(
Magento\Framework\App\Action\Context $context,
Magento\Customer\Model\Session $customerSession,
Magento\Customer\Api\AccountManagementInterface $customerAccountManagement,
) {
$this->session = $customerSession;
$this->customerAccountManagement = $customerAccountManagement;
parent::__construct($context);
}
public function sendCustomMail()
{
$email = 'customermail@example.com'; // loop your email.
try {
$this->customerAccountManagement->initiatePasswordReset(
$email,
AccountManagement::EMAIL_RESET
);
} catch (NoSuchEntityException $e) {
// Do nothing, we don't want anyone to use this action to determine which email accounts are registered.
} catch (\Exception $exception) {
$this->messageManager->addExceptionMessage(
$exception,
__('We\'re unable to send the password reset email.')
);
}
$this->messageManager->addSuccessMessage($this->getSuccessMessage($email));
}