Unix Linux Script to Attach and Embed the HTML File in Mail Body

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
(
export ATTACH="/home/sthomas/xyz.html"
export MAILPART=`uuidgen` ## Generates Unique ID
export MAILPART_BODY=`uuidgen` ## Generates Unique ID
export SUBJECT=”Attach And Embed HTML”

echo "To: $MAILTO"
echo "Subject: $SUBJECT"
echo "MIME-Version: 1.0"

echo "Content-Type: multipart/mixed; boundary=\"$MAILPART\""
echo ""
echo "--$MAILPART"
echo "Content-Type: multipart/alternative; boundary=\"$MAILPART_BODY\""
echo ""
echo "--$MAILPART_BODY"
echo "Content-Type: text/html; charset=us-ascii"
cat $ATTACH
echo "Content-Type: text/html; charset=us-ascii"
echo "Content-Disposition: inline"
echo "--$MAILPART"
echo 'Content-Type: text/html; '
echo "Content-Transfer-Encoding: uuencode"
echo 'Content-Disposition: attachment; filename="'$(basename $ATTACH)'"'
echo ""
uuencode $ATTACH $ATTACH
echo "--$MAILPART--"
) > PRINT_NAME

cat PRINT_NAME| /usr/sbin/sendmail $MAILTO

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer