more logic in server controller and mail.php to be basic, just emit event with error/syntax checks