public function sendMail(\core_kernel_classes_Resource $user)
    {
        $messagingService = $this->getMessagingService();
        if (!$messagingService->isAvailable()) {
            throw new PasswordRecoveryException('Messaging service is not available.');
        }
        $generisUser = new \core_kernel_users_GenerisUser($user);
        $userNameProperty = new \core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_FIRSTNAME);

        $messageData = array(
            'user_name' => (string) $user->getOnePropertyValue($userNameProperty),
            'link' => $this->getPasswordRecoveryLink($user)
        );
        
        $message = new Message();
        $message->setTo($generisUser);
        $message->setBody($this->getMailContent($messageData));
        $message->setTitle(__("Your TAO Password"));
        
        $result = $messagingService->send($message);
        
        return $result;
    }