Joel Cunningham Joel Cunningham - 1 year ago 92
Linux Question

Specify the from user when sending email using the mail command

Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this.

We are running Redhat Linux 5.

Answer Source

http://www.mindspill.org/962 seems to have a solution.

Essentially:

echo "This is the main body of the mail" | mail -s "Subject of the Email" recipent_address@example.com -- -f from_user@example.com

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download