加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

群发邮件的perl脚本程序

发布时间:2020-12-16 00:22:08 所属栏目:大数据 来源:网络整理
导读:#!/usr/bin/perl#open M,'../olympic_note/mail_template';open M,'tongzhi.txt';@t = M;close M;open(LIST,'liebiao.txt');#open(LOG,'havesend.olympic.080731');open(LOG,'sent.20100524.log');while(LIST) { s/[rn]//g;# ($username,$email) = split(/
#!/usr/bin/perl


#open M,'../olympic_note/mail_template';
open M,'tongzhi.txt';
@t = <M>;
close M;

open(LIST,'liebiao.txt');
#open(LOG,'>>havesend.olympic.080731');
open(LOG,'>>sent.20100524.log');
while(<LIST>) {
    s/[rn]//g;
#       ($username,$email) = split(/s+/);
    $email = $_;
    print LOG "$emailn";
    # open(MAILER,"|/usr/sbin/sendmail -t -flubingcba@51.net");
    open(MAILER,"|/usr/sbin/sendmail -t -fAccountAdmin@51.net");
    print MAILER<<XMXM;
From: 51.NET <AccountAdmin@aa.net>
To: $email
Subject:关于尽快完成域名注册信息核对的通知

XMXM
    print MAILER "@t";
    close(MAILER);
    sleep(1);
}
close LOG;
close LIST;

注释:tongzhi.txt 为邮件内容 , 编写完后 用iconv -c -f utf8 -t gb2312 tongzhi2.txt> tongzhi.txt 转换下文件编码,解决乱码问题
???????? liebiao.txt 为邮件地址列表,一行一个
???????? sent.20100524.log????日志

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读