Change the “From:” address in Unix “mail”

后端 未结 19 2158
萌比男神i
萌比男神i 2020-12-12 14:32

Sending a message from the Unix command line using mail TO_ADDR results in an email from $USER@$HOSTNAME. Is there a way to change the \"From:\" ad

19条回答
  •  我在风中等你
    2020-12-12 14:44

    Thanks BEAU

    mail -s "Subject" user@address.com -- -f from@address.com
    

    I just found this and it works for me. The man pages for mail 8.1 on CentOS 5 doesn't mention this. For -f option, the man page says:

    -f Read messages from the file named by the file operand instead of the system mailbox. (See also folder.) If no file operand is specified, read messages from mbox instead of the system mailbox.

    So anyway this is great to find, thanks.

提交回复
热议问题