I want to send an email using sendmail command in bash
. The email should get it's body by reading Input_file_HTML
and it should send same input file as an attachment too. To do so I have tried the following.
sendmail_touser() {
cat - ${Input_file_HTML} << EOF | /usr/sbin/sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: $1
Content-Type: text/html; charset=us-ascii
cat ${Input_file_HTML}
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
Content-Disposition: attachment; filename: ${Input_file_HTML}
EOF
}
The above command is giving an email with only the attachment of Input_file_HTML
and it is not writing it in the body of email. Could you please help/guide me on same? I am using outlook as the email client. I have even removed the cat
command in above command, but it also is not working.