[Perl] Perl Mail::Sender

作者:reistlin 发布时间:April 14, 2011 分类:自由点击

perl -MMail::Sender -e ''Mail::Sender->printAuthProtocols("smtp.reistlin.com")'';

#!/usr/bin/perl
 
use strict;
use Data::Dumper;
use Mail::Sender;
 
# debug switch
my $debug = 0;
 
my $sender = new Mail::Sender();
 
if ($sender->MailMsg({
	smtp => ''smtp.reistlin.com'',
	from => ''发件人@reistlin.com'',
	to => ''收件人@reistlin.com'',
	subject => "subject",
	msg => "message",
	auth => ''LOGIN'',
	authid => ''username'',
	authpwd => ''password'',
}) < 0) {
	die "$Mail::Sender::Error\n";
}
 
print "Mail Sent OK\n"

标签: perl

评论已关闭