I am sending an email by using below commands by combining all the output and sending in one email. It works fine for me.
mailx -s "LIP Data Quality Report for $DATE_YEST_FORMAT1" -r [email protected] [email protected] <<EOF
Data Successfully loaded into LIP_DATA_QUALITY table
Total Items Purchased: `echo $QUERY1 | awk '{print $1}'`
Total Items MissingorMismatch: `echo $QUERY1 | awk '{print $2}'`
Error Percentage: $QUERY2
EOF
Now I need to attach one file within the above email and that file is under temp folder
with the name of chart
. And while sending I need to send it as chart.html
file.
So How can I modify my above command so that it can attach chart
as chart.html file
from temp folder
in the email.
Hope I am clear to everyone. I am running SunOS
.
Any suggestions will be appreciated.
Updates:-
If I need to add uuencode command in my shell script so it should be like below? or something else
mailx -s "LIP Data Quality Report for $DATE_YEST_FORMAT1" -r [email protected] [email protected] <<EOF
uuencode /tmp/chart chart.html
Data Successfully loaded into LIP_DATA_QUALITY table
Total Items Purchased: `echo $QUERY1 | awk '{print $1}'`
Total Items MissingorMismatch: `echo $QUERY1 | awk '{print $2}'`
Error Percentage: $QUERY2
EOF
you can use a more versatile mail user agent like
email
from http://www.cleancode.org/projects/email which natively manages attachements