mailx- can we change the from address in the email that is sent out.

Hello,

Is there anyway to change the from address in the email sent using mailx command?

I have the following command:
mailx -s $subject xxx@xxxx.com < $mail_mesg

This defaults to the following format "acctname@usserver.companyname.com" as the from address in the email. Problem is this is not a valid one and the recieving server is bouncing the email since it's not a valid address. And we need to change the from address to be a valid one.

Any suggestions are appreciated.
Thankyou,
Radhika.

I am not finding much on this, any pointers are appreciated.

ThankYou,
Radhika.

Please read our rules:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.

I am sorry didn't mean to offend anybody. Just am desperate as it is a production issue. I figured some body must have gone through the same issue and was hoping for some help, that's all.

Thankyou,
Radhika.

Try reading the manual pages for mailx.

I figured it - it's -r option.

ex: mailx -r $returnaddress -s $subject toaddress@xxx.com < $mail_mesgfile