mailx: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/bin/mailx - from package: mailx

You may install the required package with command yum install {package}
Error in other languages:
mailx: bevel nie gevind nie
mailx: comandă negăsită
mailx: comando não encontrado
mailx: commande introuvable
mailx: command not found
mailx: käsku ei ole
mailx: không tìm thấy lệnh
mailx: komanda nerasta
mailx: Kommando nicht gefunden.
mailx: kommandot finns inte
mailx: komut yok
mailx: nie znaleziono polecenia
mailx: níor aimsíodh an t-ordú
mailx: no se encontró la orden
mailx: no s'ha trobat l'ordre
mailx: opdracht niet gevonden
mailx: parancs nem található
mailx: perintah tidak ditemukan
mailx: príkaz nenájdený
mailx: příkaz nenalezen
mailx: команда не найдена
mailx: командата не е открита
mailx: 命令找不到
mailx: コマンドが見つかりません