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

后端 未结 19 2116
萌比男神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:34

    echo "body" | mail -S from=address@foo.com "Hello"

    -S lets you specify lots of string options, by far the easiest way to modify headers and such.

提交回复
热议问题