在 Bash 中发送 HTML 电子邮件时未附加文件

在 Bash 中发送 HTML 电子邮件时未附加文件

在 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 

相关内容