mail 和mailx命令 基本语法如下: mail -s "this is the subject" $MAILOUT_LIST <$MAIL_FILE OR cat $MAIL_FILE |mail -s "this is the subject" $MAILOUT_LIST
mailx 同上
sendmail 允许加入-f开关选项来为from字段指明一个合法的内部邮件地址. sendmail命令在AIX、HP-UX和Linux上大的位置为/usr/sbin/sendmail,但在SunOS上,其位置为/usr/lib/sendmail
function send_notification { if [ -s $MAIL_FILE -a "$MAILOUT_LIST" = "TRUE" ]; then case $(uname) in AIX|HP-UX|Linux) SENDMAIL="/usr/sbin/sendmail" ;; SunOS) SENDMAIL="/usr/lib/sendmail" ;; esac echo "\nSending e-mail notification" $SENDMAIL -f randy@$THISHOST $MAIL_LIST < $MAIL_FILE fi }
|