i am trying to send email using linux mail command, it does not show any error but its not delivering to the recipient, i am using redhat 5.8 and the command i used is

echo "Hi" | mail -s 'Hi' username@gmail.com
do i need to configure any redhat file to add smtp?

PS: i have the external smtp ip also but i dont know how to configure the external smtp to send mail using it.

Any help would be greatly appreciated.

Manuj Kathuria


mail is a very old version of email and will take a little more coding than what you are doing. What you really need is a more modern mail agent like sendmail, qmail or postfix. sendmail is part of the basic Red Hat distrubution and is probably installed already. To find out more check the man pages either from google or on the server with

man sendmail