I installed mailx in Centos and trying to send mails but not going.
Below steps done:
yum install mailx
mailx -s ‘test’ email@example.com
Below logs in maillog:
status=deferred (connect to alt2.gmail-smtp-in.l.google.com:25: Network is unreachable)
Please suggest where i am getting wrong
Try this command
echo “your msg” | mailx -s “subject” firstname.lastname@example.org
What’s the output of these commands:
ping google.com cat /etc/resolv.conf
I tried echo “your msg” | mailx -s “subject” email@example.com ,still same issue.
Jan 19 11:21:42 mq1 postfix/smtp: 02B7E837B5: firstname.lastname@example.org, relay=none, delay=60, delays=0.05/0.01/60/0, dsn=4.4.1, status=deferred (connect to smtp.gmail.com[126.96.36.199]:587: Connection timed out)
I also tried ping google.com and output is “PING google.com (188.8.131.52) 56(84) bytes of data” and it got stuck there.
Please help me
mv /etc/resolv.conf /etc/resolv.conf.bak
echo "nameserver 184.108.40.206" > /etc/resolv.conf
echo "nameserver 220.127.116.11" >> /etc/resolv.conf
service network restart
Then try again.
Edit: Modified because of a mistake.