What's a good Perl OO interface for creating and sending email?

Posted by aidan on Stack Overflow See other posts from Stack Overflow or by aidan
Published on 2010-05-05T16:36:36Z Indexed on 2010/05/09 0:38 UTC
Read the original article Hit count: 276

Filed under:
|
|

I'm looking for a simple (OO?) approach to email creation and sending.

Something like

$e = Email->new(to => "test <[email protected]>", from => "from <[email protected]>");
$e->plain_text($plain_version);
$e->html($html_version);
$e->attach_file($some_file_object);

I've found Email::MIME::CreateHTML, which looks great in almost every way, except that it does not seem to support file attachments.

Also, I'm considering writing these emails to a database and having a cronjob send them at a later date. This means that I would need a $e->as_text() sub to return the entire email, including attachments, as raw text which I could stuff into the db. And so I would then need a way of sending the raw emails - what would be a good way of achieving this?

Many thanks

© Stack Overflow or respective owner

Related posts about perl

Related posts about email