Chinaunix首页 | 论坛 | 博客
  • 博客访问: 466854
  • 博文数量: 279
  • 博客积分: 4467
  • 博客等级: 上校
  • 技术积分: 2830
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-03 14:43
文章分类

全部博文(279)

文章存档

2013年(1)

2012年(39)

2011年(35)

2009年(29)

2008年(131)

2007年(44)

分类:

2008-01-22 11:46:30

(1)发送附件
#!/usr/bin/perl

use Mail::Sender;

$sender = new Mail::Sender{

smtp =>; 'localhost', 

from =>; 'xxx@localhost'
};

$sender->;MailFile({

to =>; 'xxx@xxx.com',

subject =>; 'hello',

file =>; 'Attach.txt'

});

$sender->;Close();


print $Mail::Sender::Error eq "" ? "send ok!\n" : $Mail::Sender::Error;


(2)发送html内容:
#!/usr/bin/perl

use Mail::Sender;

open(IN, "< ./index.html") or die("");



$sender = new Mail::Sender{

smtp =>; 'localhost', 

from =>; 'xxx@localhost'

};


$sender->;Open({

to =>; 'xxx@xxx.com',

subject =>; 'xxx',

msg =>; "hello!",

ctype =>; "text/html",

encoding =>; "7bit",

});



while(;)

{

$sender->;SendEx($_);

}

close IN;

$sender->;Close();



print $Mail::Sender::Error eq "" ? "send ok!\n" : $Mail::Sender::Error;
阅读(553) | 评论(0) | 转发(0) |
0

上一篇:perl中的特殊变量

下一篇:html::parse

给主人留下些什么吧!~~