全部博文(279)
分类:
2008-01-22 11:46:30
(1)发送附件#!/usr/bin/perl(2)发送html内容:
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;
#!/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;