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

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

    On CentOS this worked for me:

    echo "email body" | mail -s "Subject here" -r from_email_address email_address_to
    

提交回复
热议问题