You will need to use a php application such as universal Email for sending the mail instead of the pearl script.
universal Email will be applied to the same page as the form so that the form will post to itself. This will allow the validation code to process and the email to be sent.
See the "Creating an HTML email" Tutorial in the Solution recipes section of the Universal Email support page:
universal-email/