Mailx options to change from address

hi,

I had a request to change the from email address while sending the email to the users.

Current From email address : pepsimanufacturer@pepsi.com

Requested From Email Adreess: manucturer@pepsi.com

Any idea how the from addres can be changed.

---------- Post updated at 06:42 AM ---------- Previous update was at 05:55 AM ----------

does below command work

man mailx
mailx -r address Pass address to network delivery software. All
tilde commands are disabled.

mailx -r new_from_name does what you want. It does not change the actual source information of the email in the header information. Just what users see on the other end. We have phishing detection software that will flag incoming email with aliases like this, I believe.

yes i would need to change the from address in the email permanetly.
any idea how it can be changed permanently.

Hello arun,

Could you please try following if that helps you.

MAILFROM=Singh&Singh@Singh.com
TO=Singh@chumma.com
SUBJECT="TEST"
Input_file="/tmp/singh_test/Input_file"
cat - ${Input_file} <<EOF | /usr/sbin/sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: $SUBJECT
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
EOF

Thanks,
R. Singh