Who is your web host ?
This kind of error checking should really be built into any reasonable CGI script.
If it isn't, you can find plenty of email scripts out there to use that do offer required field confirmation.
I'd imagine that it's probably down to you not specifying that the fields are required to begin with.
First port of call should be your web host and either ring or email them to ask whether they have a preconfigured or recommeneded email CGI that allows required fields to be specified.