1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#!/usr/local/bin/perl -w
use Mail::Send;
print "1..11\n";
my $i = 1;
$msg = new Mail::Send or print "not ";
printf "ok %d\n",$i++;
$msg = new Mail::Send
Subject => 'example subject',
To => 'timbo'
or print "not ";
$msg->to('user@host') == 1 or print "not ";
printf "ok %d\n",$i++;
$msg->subject('user@host') == 1 or print "not ";
printf "ok %d\n",$i++;
$msg->cc('user@host', 'user2@no.where') == 2 or print "not ";
printf "ok %d\n",$i++;
$msg->bcc('someone@else') == 1 or print "not ";
printf "ok %d\n",$i++;
$msg->bcc('nobody@here') == 1 or print "not ";
printf "ok %d\n",$i++;
$msg->set('X-Test', 'a test entry') == 1 or print "not ";
printf "ok %d\n",$i++;
$msg->add('X-Test', 'another test entry') == 2 or print "not ";
printf "ok %d\n",$i++;
$msg->set('X-Test2', 'a test2 entry') == 1 or print "not ";
printf "ok %d\n",$i++;
$msg->set('X-Test2', 'replaced') == 1 or print "not ";
printf "ok %d\n",$i++;
$msg->delete('X-Test') or print "not ";
printf "ok %d\n",$i++;
#my $fh = $msg->open('testfile'); # produces 'mailer.testfile'
#$fh->close;
|