What is a good Perl OO interface for creating and sending emails?

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

Sort of

$e = Email->new(to => "test <test@test.com>", from => "from <from@from.com>");
$e->plain_text($plain_version);
$e->html($html_version);
$e->attach_file($some_file_object);

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

In addition, I am thinking of writing these letters to the database and sending a cronjob later. This means that I will need $e->as_text()sub to return all email, including attachments, as the source text that I could add to db. And so I would need a way to send raw emails - what would be a good way to achieve this?

Many thanks

+5
source share
3

, .

Email::MIME::CreateHTML:

my $email = Email::MIME->create_html(

, , Email::MIME. . parts_set parts_set .

Email::MIME Email::Simple. . as_string .

. Email::Sender .

+4

perl MIME:: Lite.

:

### Get entire message as a string:
$str = $msg->as_string;
+2

Email::Stuff - Email:: MIME. MIME , .

Email::Stuff->from     ('cpan@ali.as'                      )
            ->to       ('santa@northpole.org'              )
            ->bcc      ('bunbun@sluggy.com'                )
            ->text_body($body                              )
            ->attach   (io('dead_bunbun_faked.gif')->all,
                        filename => 'dead_bunbun_proof.gif')
            ->send;

as_string.

+1

All Articles