I would like to send a mail via a script with customized From field or at least with Reply-To. This email is sent by a monitoring server via a cron job and the users should see this mail as coming from the group mailbox I belong to.
I haven't been able to find how to send a mail with a different address in the From but from the command line I can change the Reply-to (better than nothing). If I use the same in a script it doesn't work... Here is what I did :
Expand|Select|Wrap|Line Numbers
- myserver> mail -s 'test mail' destination@test.org
- ~R reply.here@test.org
- content of the message
- .
- EOT
Expand|Select|Wrap|Line Numbers
- #!/usr/local/bin/bash
- cat << EOF | mail -s 'test mail' destination@test.org
- ~R reply.here@test.org
- content of the message
- EOF
Any idea why this behaviour? Any idea how to set the from field?
Thanks,
Krik