change mail sender in unix aix

Hi All,

I have a ksh script, in which it sends mail successfully but from root id(root@system.com). I want it to be sent as customid@system.com.
I verified man pages of mail, and found '-u userid' option. But it is failing.

code snippet below:
mail -s "subject" -u $customid toaddress@mail.com

I saw some other discussion also, but i cannot find the exact one. Most of the discussion is based on Solaris box, with -r option, that doesn't work in AIX.
Please guide me to make this happen successfully.

Thanks in Advance!

Arun ,
Did you tried using mailx command

mailx -s "subject" xyz@zz.com(userid)

Thanks for the tip,
But Not working!

i tried like below:
mail -s "test mail from test environment" arunprasad@domain.com (thangaraj)

as per above code, i logged in with my account: arunprasad and i am sending mail to my id, but the mail will be sent as with thangaraj id, not from my id.

Please correct me if my understanding is wrong.
Below is the error message i am getting when execute the above code:
ksh: syntax error: `(' unexpected

Please help me!

just try echo "hello world" | mailx -s "SUBJECT" abc@xyz.com

Start using the Forum's 'Search' functionality to locate similar posts.
The 'google unix.com' is located in the upper right corner of the portal.
Search for sendmail+different+user for example.

Arun ,
Can you help me to understand how to post a question in this form i am able to reply to the questions but not the other way around.. Sorry to trouble you but i am new this site ...any help would be greatly apprecaited

All,

Here i got a point, as my earlier code i have tested was abended due to no mail body.
Here it works with the below:

cat filename.txt | mail -r "\"useridwewant"\" -s "subject" mailid.com

the above is working fine, but the same i tried with -u option in mail command:

cat filename.txt | mail -u "useridwewant" -s "subject" mailid.com

the above command is failing to send mail and throwing me the below error:
"Cannot give this flag and people to send to."

Please help me out.

and one more,
i have tested the same with the below code:

prompt>echo "test" | mail -r "\"someothermailid"\" -s "sample" arunprasad.thangaraj@domain.com
prompt>

The below is the sender information:

Note: i received mail successfully with different sender name. what i logged in as "myownid". Now i can able to change the sender mail id.

I am using Lotus Notes and the above mail will display as "123/C//Company/someothermailid/USR " and date and subject in my inbox. When i open only i can see the mail address of the sender. This postmaster note is not changing.

My another requirement is, to send a mail which receives like: "someothermailid <someothermailid@domain.com>" not like "123/C//Company/someothermailid/USR <someothermailid@domain.com>".

can you please help me out, how i can achieve this?