#!/usr/bin/perl -w
$|=1;
use strict;
use MIME::Lite;
my @addrs=qw/ nobody@nowhere.com my_real_mail@myisp.com /;
#
# This is one bogus email address and one good
# email address. The good address has been sanitized
# for this posting.
foreach my $addr(@addrs){
printf "Sending email to %s...",$addr;
my $msg = MIME::Lite -> new (
From => 'my-return@isp.com',
To => $addr,
Subject => 'this is a test',
Type=> 'TEXT',
Data => 'test 1 2 3...'
);
MIME::Lite->send("smtp","localhost",Port=>9925);
$msg->send;
printf "Message sent.\n";
}
####
#!/usr/bin/perl -w
$|=1;
use strict;
use MIME::Lite;
my @addrs=qw/ nobody@nowhere.com me@my-isp.net /;
my $msg = MIME::Lite -> new (
From => 'me@my-isp.ne',
To => join(",",@addrs),
Subject => 'this is a test',
Type=> 'TEXT',
Data => 'test 1 2 3...'
);
MIME::Lite->send("smtp","localhost",Port=>9925);
$msg->send;
printf "Message sent.\n";
####
MIME::Lite->send("smtp","localhost",Port=>9925);