我通过使用以下命令发送电子邮件,方法是将所有输出和发送到一个电子邮件中。这对我来说可以。使用shell脚本在电子邮件中附加一个html文件
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
现在我需要附上上述电子邮件中的一个文件,该文件是temp folder
下与chart
名称。发送时我需要将它作为chart.html
文件发送。
那么如何修改我的上述命令,以便它可以在电子邮件中附加chart
作为chart.html file
来自temp folder
。
希望我明白给大家。我正在运行SunOS
。
任何建议,将不胜感激。
更新: -
如果我需要在我的shell脚本添加的uuencode命令所以它应该是像下面?还是其他什么东西
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
[如何使用HP-UX shell脚本将简单文本文件发送为附件?](http://stackoverflow.com/questions/6274325/how-to-send-simple-text-file-as- attachment-using-hp-ux-shell-script) – 2012-08-13 05:50:47
使用Python或Perl编写MIME消息比使用shell脚本更容易。 – 2012-08-13 09:12:18