mutt发送HTML格式的邮件,则mutt版本为1.5以上
如下:
#rpm -qa mutt
mutt-1.5.20-2.20091214hg736b6a.el6_1.1.x86_64
简单的脚本实例:
#!/bin/bash
#
#
#临时文件
result=/tmp/${0##*/}.html
result_temp=/tmp/${0##*/}_temp.html
#邮件主题
subject="数据库备份结果"
#发件人
mailfrom=xxxx@XXXX.com
#收件人
mailto=xxxxx@xxx.com
#获取内容
DATE=`date +"%Y-%m-%d"`
awk -F' |=' '/piece handle|elapsed time/{if(NF == 7) {printf $3" " } else {print $NF}}' /backup/log/$DATE".log" >$result_temp
#定义文件ID
n=1
#邮件内容
cat > $result <<EOF
<html>
<body>
<head>
<style type="text/css">
<!--
td {font-size:9pt;color=#3333FF;height:23pt;nowrap}
-->
</style>
</head>
<p>This is Oracle Database Backup information.</p>
<table align&#