Mailx not sending mail and showing "Network is unreachable"

HI ,
I installed mailx in Centos and trying to send mails but not going.
Below steps done:
yum install mailx
mailx -s ‘test’

Below logs in maillog:
status=deferred (connect to Network is unreachable)

Please suggest where i am getting wrong


Try this command

echo “your msg” | mailx -s “subject”

What’s the output of these commands:

ping cat /etc/resolv.conf

Hi ,

I tried echo “your msg” | mailx -s “subject” ,still same issue.
output is:

Jan 19 11:21:42 mq1 postfix/smtp[38264]: 02B7E837B5:, relay=none, delay=60, delays=0.05/0.01/60/0, dsn=4.4.1, status=deferred (connect to[]:587: Connection timed out)

I also tried ping and output is “PING ( 56(84) bytes of data” and it got stuck there.

Please help me

Execute these:

mv /etc/resolv.conf /etc/resolv.conf.bak
echo "nameserver" > /etc/resolv.conf
echo "nameserver" >> /etc/resolv.conf
service network restart

Then try again.

Edit: Modified because of a mistake.

1 Like