the RegisterToBeAnAuthorizedRetailer.php file looks correct, the validation is first then the UE code block
they both use the same button trigger.
There is no captcha to prevent a automated script from filling in the form though.
moving the email code into the body will not prevent spam, if anything it would prevent the email from working all.
you should add captcha validation to the page to prevent spam.