Hey! here is the solution for the below pasted error while you are trying to send emails by using a script. You can simply fix this issue by installing the package mailx.
mail: command not found
yum install mailx service postfix start chkconfig postfix on