Mail::Sender.
For example, you can write a normal Perl program to send a message.
The following program is a sample program that does exactly that.
use Mail::Sender;
use strict;
use warnings;
my $m = new Mail::Sender{smtp=>'localhost', from=>'me@myserver.net'};
$m->Open({
to=>'you@yourserver.net',
cc=>'theothers@somewhere.net',
subject=>'important issue',
replyto=>'myotheraccount@myserver.net'});
$m->Send(<<'END');
Whatever message I want to send.
END
$m->Close();
Now, let me explain what each line does.
use Mail::Header
use statement to include a Perl module.
my $m = new Mail::Sender
{
from=>'myaddr'
fake_from=>'shownmyaddr'
replyto=>'reply-to-addr'
from address.
to=>'destaddr'
fake_to=>'faked-to-addr'
cc=>'cc-addr'
to, but for
carbon-copy.
fake_cc=>'fake-cc-addr'
fake_to,
but for copy-copy.
bcc=>'bcc-addr'
cc, but for
blind carbon copy (not shown in the mail).
smtp=>'smtp-server'
localhost works for your
Power account. localhost should work on most web hosting
setups.
subject=>'A subject line'
priority=>'3'
confirm=>...
delivery for just delivery
confirmation, reading for read (click) confirmation,
or 'delivery, reading' for both.
Mail::Sender documentation
at CPAN for more discussions!
}
m->Send(<<'END');
END on it.
END
$m->Close();
Copyright © 2008-05-09 by Tak Auyeung