File is not attached while send in HTML email Bash
Below is my sample script ,while executing the script the mail was sent with out an attachment. Please help.
#!/bin/bash
FOUND_EMAIL_TEXT="This is an automated report generated .
Please investigate and remediate them as soon as possible."
(
echo "From: xyz@abc.com"
echo "To: xyz@abc.com"
echo "MIME-Version: 1.0"
echo "Subject: Test Email"
echo "Content-Type: text/html"
echo "<FONT FACE='COURIER NEW' SIZE='5'>;<PRE>"
echo -e "${FOUND_EMAIL_TEXT}
echo "</PRE><;/FONT>;"
echo "Content-Type: text/html"
echo 'Content-Disposition: attachment; filename="'/ght.txt/'"'
echo "$(cat /home/dfg/ter.txt)"
) | sendmail -t
echo -e "${FOUND_EMAIL_TEXT}
line. Is that a typo here in your question or is it part of your script? – terdon Sep 12 '20 at 11:54mpack
– Chris Davies Sep 12 '20 at 12:33