heirloom-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

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 Debian possible default full paths are:

/usr/bin/heirloom-mailx - from package: heirloom-mailx

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