Bash: Sending Html With An Attached File?
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
Solution 1:
Try this:
( cat body.html; uuencode in-attachfile.txt out-attachfile.txt ) | mail -s "my subject" -a "Content-Type: text/html"foo@example.com
You may want to send the attachment using MIME (via mutt, for example). See this for more information.
Post a Comment for "Bash: Sending Html With An Attached File?"