批量发送邮件
#!/bin/bash
echo ""> sended.txt
cat /root/tmp/mail.txt | while read line
do
echo $line >> sended.txt
/usr/sbin/sendmail -t <<EOF
SUBJECT:=?UTF-8?B?编码内容主题?=
TO: $line
From:=?UTF-8?B?编码内容-发件人?= <XXX@XXX.com>
Content-type: text/html ---html形式
Content-type: text/plain ---文本形式
----
内容征文
----
done
编码内容可以从这里查询http://blog.gxceo.com/gj/base64.html
如果发送比较慢,则修改host文件,将主机名追加到localhost后边,然后重启sendmail即可,或者修改/etc/mail/sendmail.cf
中127.0.0.1根本机一样即可,不过后一种不一定好使