None of the above solutions are working for me...
#!/bin/bash
# Message
echo "My message" > message.txt
# Mail
subject="Test"
mail_header="From: John Smith <[email protected]>"
recipients="[email protected]"
#######################################################################
cat message.txt | mail -s "$subject" -a "$mail_header" -t "$recipients"