mailx not working on SunOS 5.9

I m trying to send o/p of one file using mailx command but is not working

PFB command :

 
cat healthchecklog | mailx -s "HEALTH CHECKS" abc@jkl.com

also I have checked the ps -ef for mailx which is giveing below o/p

 
ps -ef | grep mail

    root   364     1  0   Jun 08 ?        1:09 /usr/lib/sendmail -bd -q15m
   smmsp   365     1  0   Jun 08 ?        0:09 /usr/lib/sendmail -Ac -q15m

please help this out urgently

try using...

/bin/mail -s

Look at /etc/syslogd.conf and find out where your mail log is.
Providing that you didn't actually get an error message from the mailx command, the diagnostics should be in the mail log.

i reffered the syslogs and its giving below error at many places.

I'm assuming that def.abc.com is different from abc@jkl.com .

This suggests that the mail relay host referred to in the DS line in sendmail.cf is broken or misconfigured in some way. If this has never worked, then perhaps the mail relay host is not listening for SMTP mail or does not know that your server exists.

You should be able to see how much mail you have queued with the mailq command.

Btw. If you get an error message, please post the whole error message (blotting anything confidential like email addresses or machine names with Xs).

o/p of mailq command

 
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
q7ND06XW004652    35745 Thu Aug 23 14:00 <qrs@a.b.com>
                 (Deferred: Connection refused by def.abc.com )
                                         <abc@jkl.com >
q7NC06XW006578    30147 Thu Aug 23 13:00 <qrs@a.b.com>
                (Deferred: Connection refused by def.abc.com )
                                         <abc@jkl.com >

Is this a new configuration, or one which used to work?

You can try to see if the mail relay server is listening at all and if so, what Operating System it is:

telnet def.abc.com 25

(Use ctrl/] to get out of the telnet).

Before long you are going to need to talk to the administrator of the SMTP mail relay server.

the senmail.cf file has not chnaged for many years

telnet is giving error as unknown host.

What you you get for:

nslookup def.abc.com

Does it give you an IP address? Is it the right IP address?
If you are using DNS, is your DNS server down?
If you are using /etc/hosts , has the line containing def.abc.com gone missing or got corrupted?

Can you connect with telnet to port 25 by using the IP address not the name?

Also, if you have these files what do the non-comment lines say?

/etc/resolv.conf
/etc/nsswitch.conf
/etc/mail/service.switch

Did the authorisation/authentication process change on the receiving end? "Connection refused" indicates permission problems, be it wrong ports or malauthorisation/-authentication.

I definitely don't have a server of that name and can reproduce the error message with a unix telnet (albeit not SunOS):

telnet def.abc.com 25
def.abc.com: Unknown host