最新消息:

Perl 发送邮件

优化监控 admin 1浏览

安装
tar -zxvf Mail-Sender-0.8.16.tar.gz
cd Mail-Sender-0.8.16
perl Makefile.PL
make && make install

[root@jishu localhost]$ cat smail

!/usr/bin/perl

use strict;
use Getopt::Std;
use Mail::Sender;
use vars qw($opt_d $opt_m $opt_f $opt_s);
getopts(‘d:m:f:s:’);
my $sender = new Mail::Sender {
smtp => ‘mail.selboo.com.cn’,
  from => ‘root@selboo.com.cn’,
auth => ‘LOGIN’,
authid => ‘root@selboo.com.cn’,
authpwd => ‘1234567890’,
on_errors => undef,
} or die “$Mail::Sender::Error\n”;
$sender->MailFile({
to => $opt_d,
subject => $opt_s,
msg => $opt_m,
file => $opt_f
}) or die “$Mail::Sender::Error
Usage: $0 -d mailaddress -m mailmessage -s subject -f filename\n”;
$sender -> Close();

使用方法
[root@jishu localhost]$ ./smail
No message specified
Usage: /usr/bin/smail -d mailaddress -m mailmessage -s subject -f filename

下载文件 (已下载 279 次)

点击这里下载文件: Mail-Sender-0.8.16.tar.gz

但是不支持html邮件,

支持html邮件 http://selboo.com.cn/post/626/相关日志Extman字符验证码改为数字验证码
Nginx perl cgi 支持
mutt 发送邮件命令
将邮件导入 Gmail
perl邮件群发脚本(V0.3版)

最后编辑: selboo 编辑于2011/09/03 01:58

转载请注明:爱开源 » Perl 发送邮件