Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

To send mail with same format as in file

$
0
0
I want to send the content in same format as it is in file.

Code:

#!/bin/sh
cat /usr/test/abc  > /usr/test/abc/file
if [ -s /usr/test/abc/file ]
then
MAILTO=test@yahoo.com
CONTENT="/usr/test/abc/file"
(
echo "Subject: TEST "
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
cat $CONTENT
) | /usr/sbin/sendmail -t $MAILTO
else
echo "bbb"
fi


Viewing all articles
Browse latest Browse all 16232

Trending Articles