Setting headers using the /bin/mail command
There are many different versions of mail
(see Mail vs. mail what is the difference and the Heirloom project's write-up on the different versions of mail
).
If you want to keep your sanity, I recommend avoiding any tool whose name is too close to mail
. Mutt is a lean text mode mail client which is often available, very flexible, and behaves the same everywhere.
mutt -H - "$2" <<EOF
From: $1
To: $2
Subject: $3
Importance: high
$4
EOF