配置文件以下:vim
[root@localhost ~]# vim /etc/mail.rcide
set from=zebra9301@163.com smtp=smtp.163.com測試
set smtp-auth-user=zebra9301@163.com smtp-auth-password=密碼blog
set smtp-auth=loginget
在所用郵箱開啓smtp協議input
測試it
[root@localhost ~]# echo "hello" | mail -s "hello test" zebra9301@163.comio
郵箱收到郵件class
PS:test
read -p 'Please input QQ' QQ
read -p 'Please input the mail-number' n
for i in `seq $n ` ; do echo ‘hello $i ’ | mail -s "hello $i" $QQ@qq.com &> /dev/null ; done