I'm looking for a way to send an HTML email from bash with an attached file. I've tried the following line, but it doesn't work 100%. The below line sends an HTML email, but there is no attached file:
( cat body.html ; uuencode in-attachfile.txt out-attachfile.txt ) | mail -s "$(echo -e "my subject\nContent-Type: text/html")" [email protected]
If I remove the Content-Type: text/html to indicate this is an HTML email then the attachment works:
( cat body.html ; uuencode in-attachfile.txt out-attachfile.txt ) | mail -s "$(echo -e "my subject")" [email protected]
How can I have both?
Thank you