1

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 
Renga
  • 393

0 Answers0