Linux中使用命令发邮件以及附件的方法

1 attachment=`(echo '"name","rbdomain","ridomain","impressions","spend"';echo -n "$report") | uuencode topDomainReport_$yesterdayDate.csv`
2         echo -e "Subject: Top Domain Report - $yesterdayDate\nTo: $email_address\nCc: $QAlist\n$attachment" | sendmail -f rtb -t

其实很简单~主要是使用sendmail

具体的用法大家可以直接man sendmail

主要的内容是如何在邮件里面加入附件 -- uuencode

上面的代码里面就有用法.

uuencode可以接受STDIN,也可以指定input file.

同样,具体的用法可以man,都很简单啦

 

posted @ 2014-01-24 10:28  linehrr-freedom  阅读(242)  评论(0编辑  收藏  举报