阅读背景:

linux 使用mail 发送邮件

来源:互联网 
#!/bin/bash
#author:findyou
help(){
echo "eg:
#!/bin/bash
#author:findyou
help(){
echo "eg: $0 [Subject] [address] [content_file] [file]"
echo ""
exit
1
}

if [ ! -n "$1" ] ; then
help
fi

cDate
=`date +%Y%m%d`

if [ ! -n "$2" ] ; then
help
else
mail_to
=$2
echo " Send Mail to ${mail_to}"
fi

if [ ! -n "$4" ] ; then
mail
-s $1 ${mail_to}<$3
else
mail
-s $1 -a $4 ${mail_to}<$3
fi

[Subject] [address] [content_file] [file]eg:
#!/bin/bash
#author:findyou
help(){
echo "eg: $0 [Subject] [address] [content_file] [file]"
echo ""
exit
1
}

if [ ! -n "$1" ] ; then
help
fi

cDate
=`date +%Y%m%d`

if [ ! -n "$2" ] ; then
help
else
mail_to
=$2
echo " Send Mail to ${mail_to}"
fi

if [ ! -n "$4" ] ; then
mail
-s $1 ${mail_to}<$3
else
mail
-s $1 -a $4 ${mail_to}<$3
fi




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: