- 1# ! /usr/bin / perl - w 2 use strict;
- 3 use Mail: :Sender;
- 4 5 my $count = 1;
- 6
- while (1) {
- 7 my $sender = Mail: :Sender - >new({
- 8 smtp = >'smtp.163.com',
- 9#这里以163为例10 from = >'这里写你的163邮箱地址: ',
- 11 auth = >'LOGIN',
- 12 authid = >'这里写你的163邮箱用户名: username',
- 13 authpwd = >'这里写你的邮箱密码: password'
- }
- 14) or die "Cannot send mail:$!\n";
- 15 16 my $messages = 'hello这里是要发送的内容';
- 17 18 $sender - >MailMsg({
- 19 to = >'要发送到哪个邮箱: ',
- 20 subject = >'邮箱标题',
- 21 msg = >$messages
- }
- 22);
- 23 $sender - >Close();
- 24 print "第$count封发送完毕!\n";
- 25 $count++;
- 26
- }
来源: http://www.bubuko.com/infodetail-1861813.html