configure from address in mailx command

Hi,

I need to configure customized from address in mailx command.
Can you pls tell me the option for configuring from address.

Thanks
Latika

check -r option

check this Mail with From Address

It can be done using

echo "testing 1 2 3 " | mailx -s "subject" -r <sender_mailid> <receiver_mailid>

i'm using linux - bash shell,
in mailx man page, i couldn't seen the -r option itself.

can you please tell me any other option is there to resolve it.

thanks in advance

check whether you have sendmail command

yes , sendmail is there.

Is there no way to configure sender address in bash mailx?

did u get any error if u use -r ?

Got below error message
,
mailx: invalid option -- r
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
[-- sendmail-options ...]
mail [-iInNv] -f [name]
mail [-iInNv] [-u user]

used below command,
echo "testing msgs" | mailx -r 'latika <no-reply-to@host>' -s 'testing mail with from address' 'to@address'

hmm, some of the mailx version support -r option.

If you want to using particular email id, then try sendmail

try using

 
 
 echo "testing 1 2 3 " | mail -s "subject" abc.com -- -f abc.com 
1 Like