Hi Ali,
That error message is triggered most often when your Moodle instance isn't set up to send email. Is other email sending correctly?
If not, you'll need to set up your Moodle instance to send messages first. You can (if you're an administrator) review the settings at yourmoodleurl/admin/settings.php?section=outgoingmailconfig