2012-09-26 56 views
0

是否可以發送一個excel附件,其中一些行中的紅色突出顯示了?UNIX中的格式化excel附件sendmail

目前我使用下面的編碼發送計劃格式(類似)的Excel附件:

(
echo "From: $MAILFROM" 
echo "To: $MAILTO" 
echo "Subject: $SUBJECT" 
echo "MIME-Version: 1.0" 
echo "Content-Type: multipart/mixed; boundary=\"-$MAILPART\"" 
echo "---$MAILPART" 
echo "Content-Type: text/html" 
echo "Content-Disposition: inline" 
cat $BODY 
echo "---$MAILPART" 
echo 'Content-Type: application/pdf; name="'$(basename $ATTACH)'"' 
echo "Content-Transfer-Encoding: base64" 
echo 'Content-Disposition: attachment; filename="'$(basename $ATTACH)'"' 
uuencode -m $ATTACH $(basename $ATTACH) 
echo "---$MAILPART--" 
) | /usr/sbin/sendmail $MAILTO 

有沒有辦法在上面的代碼中添加一些東西來達到同樣的?

回答

0

無論你在Excel中有細胞的顏色的文件,您可以使用相同的腳本發送任何類型的文件有小改動劇本:

(
echo "From: $MAILFROM" 
echo "To: $MAILTO" 
echo "Subject: $SUBJECT" 
echo "MIME-Version: 1.0" 
echo "Content-Type: multipart/mixed; boundary=\"-$MAILPART\"" 
echo "---$MAILPART" 
echo "Content-Type: text/html" 
echo "Content-Disposition: inline" 
cat $BODY 
echo "---$MAILPART" 
echo 'Content-Type: application/octet-stream; name="'$(basename $ATTACH)'"' 
echo "Content-Transfer-Encoding: base64" 
echo 'Content-Disposition: attachment; filename="'$(basename $ATTACH)'"' 
uuencode -m $ATTACH $(basename $ATTACH) 
echo "---$MAILPART--" 
) | /usr/sbin/sendmail $MAILTO