Hello,
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 :
This works fine, the reply-to is correctly set. Now, the script I wrote :
With this script I receive the mail with the ~R line in the body and the reply-to is not set...
Any idea why this behaviour? Any idea how to set the from field?
Thanks,
Krik
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 :
Code:
myserver> mail -s 'test mail' destination@test.org ~R reply.here@test.org content of the message . EOT
Code:
#!/usr/local/bin/bash cat << EOF | mail -s 'test mail' [email]destination@test.org[/email] ~R [email]reply.here@test.org[/email] content of the message EOF
Any idea why this behaviour? Any idea how to set the from field?
Thanks,
Krik
Comment