
HTML メール Bash に送信するときにファイルが添付されない
以下は私のサンプルスクリプトです。スクリプトを実行すると、電子メールは添付ファイルなしで送信されます。助けてください。
#!/bin/bash
FOUND_EMAIL_TEXT="This is an automated report generated .
Please investigate and remediate them as soon as possible."
(
echo "From: [email protected]"
echo "To: [email protected]"
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