use Email::Send;
my $message = <<'__MESSAGE__';
To: recipient@example.com
From: sender@example.com
Subject: Hello there folks
How are you? Enjoy!
__MESSAGE__
my $sender = Email::Send->new({mailer => 'SMTP'});
$sender->mailer_args([Host => 'smtp.example.com']);
$sender->send($message);
# more complex
my $bulk = Email::Send->new;
for ( qw[SMTP Sendmail Qmail] ) {
$bulk->mailer($_) and last
if $bulk->mailer_available($_);
}
$bulk->message_modifier(sub {
my ($sender, $message, $to) = @_;
$message->header_set(To => qq[$to\@geeknest.com])
});
my @to = qw[casey chastity evelina casey_jr marshall];
my $rv = $bulk->send($message, $_) for @to;
I expect there to be at least two more RC releases of the distribution. It still needs a little more work. Feel free to take a look and comment.
As you can see with the message_modifier() method I tried to address the idea of sending email in bulk. I can see where someone might choose to do a mail merge with Template Toolkit. This method would help with that. It is maximum flexibility.
In any case, JDFI week has been extended. :-)
Posted from caseywest.com, comment here.