Prayer letter

Oh yeah, prayer letter. Since it's been all spiritual and no Perl recently, I should say that that was produced with a modified version of the script I wrote about in The Perl Journal last year, and I used MIME::Lite::HTML to create a mixed HTML and plain-text email from the two Template Toolkit formats. Now since you can't do this directly from MIME::Lite::HTML, here's the trick:

my $x = MIME::Lite::HTML->new(
    From => 'simon@simon-cozens.org',
    To   => 'prayerletter@lists.netthink.co.uk',
    Subject => $vars->{title},
) ;
use File::Slurp;
$x->build_mime_object(scalar read_file($output), scalar read_file("email.txt"), []);
MIME::Lite->send('smtp', "localhost");
print "Sending to list\n";
$x->{_MAIL}->send;

Full version - 1 Comment