Question : email excel sheet as attachment using Sendmail

Experts,

Am having Sendmail installed on SunOS... Am able to attach and email Plain/Text file
But when i tried to attach & send Excel sheet using my script. am receiving excel sheet. when i download and open Ooops the file is in unrecognized format.....

I tried Content-type as application/vnd.excel
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
{
echo To: $EMAIL_TO
echo From: $EMAIL_FROM
echo Subject: $EMAIL_SUBJECT
echo 'MIME-Version: 1.0'
echo 'Content-type: multipart/mixed; boundary="***"'
echo '--***'
echo ''
echo $EMAIL_BODY
echo '--***'
echo 'Content-Disposition: attachment; filename="'$FILE_NAME'"'
echo ''
cat $ATTACHED_FILE
echo '--***'
} | /usr/sbin/sendmail -t $EMAIL_TO

Answer : email excel sheet as attachment using Sendmail

send mail will not work. try

uuencode myfile.xls myfile.xls | mailx -s   username@domain

if mailx is not working , use mail command
Random Solutions  
 
programming4us programming4us