在perl中使用本机的sendmail发送邮件的代码如下:
#!/usr/bin/perl
use strict;
my($r_mail) = 'xxxx@163.com';
my($s_mail) = 'root@abc.cn';
my($subject) = '邮件标题';
open(MAIL, '|/usr/lib/sendmail -t');
select(MAIL);
print<<"END_TAG";
To: $r_mail
From: $s_mail
Subject: $subject
邮件内容,database is ok!
END_TAG
阅读(2564) | 评论(0) | 转发(1) |