Added sendmail validation, added exit codes.