Need to send mail using mail command

Hi Guys,

Am tried with the mail & mailx command to send mail to other localhost machine, Which are all connected in a LAN. I can not able to send, Either it wont display any error message at that time and later am receiving a failure mail.. But i can send and receive (from-to) in my machine.. What is the problem with that? Shall i need to configure any packages for this.?? Please help me ASAP!

---
Thank you!!

Can you please post the whole command that you are using?

mail -s "HI" adhi@localhost.localdomain

Try mailx instead, also use following if you are sending a message with no body:-

mailx -s "Hi" adhi@localhost.localdomain < /dev/null

Ya. Am tried this too... But I can not able to reach the destination machine... Not at all a problem to send and receive myself in a same machine.. The thing is I want to send to another Localhost machine!!

If you want to send to another machine you should try:-

mailx -s "Hi" user@FQDN < /dev/null

where FQDN is the Fully Qualified Domain Name of other machine.

Really sorry Bipinajith.. Its also not working for me..:wall:

Can you run following 2 commands on the other machine and post the result?

whoami
nslookup `hostname`

whoami---- adhi
nslookup `hostname`----- ;; connection timed out; no servers could be reached
hostname----- localhost.localdomain

Can you login to the other machine where you want to receive the mail and run the command

hostname

. Please don't replace hostname with localhost.localdomain, just run

hostname

and post the result.

Ya.. We are all connected with the same LAN.. So localhost.localdomain is the hostname for everyone.. The username only varies...

I don't think localhost.localdomain is the correct hostname, otherwise you won't get the below error when you ran the command I mentioned:-

connection timed out; no servers could be reached

Can you run the command hostname and recheck?

localhost.localdomain is the hostname..

Can you try sending email using the IP address instead of hostname:-

mailx -s "Hi" adhi@ipaddress < /dev/null

Replace ipaddress with your machines IP address.

Sorry Man.. Still damn its not working!! :wall:

can you ping your mail server?

ping localhost.localdomain

Ya.. I can Ping.. And its working good!!

ok so to confirm the same server you are using is the same mail server?

Yups!!

what is your os on both machines? have you done a trace? checked your ifconfig's? have you checked to make sure your filesystems are not full? if you can provide as much info about what you have already troubleshooted already would help. looking though the form looks like all that was tried was mail commands.