On Sun, Jun 07, 2009 at 07:28:13PM -0400, Ricardo SIGNES wrote:
> Well, Email::Sender doesn't deal with attachments at all.  It doesn't know
> what's in your message, beyond *maybe* looking at the to/from headers.
> Attachment stuff is all handled by Email::MIME.
> 
> Can you give me an idea what the Perl you want to write would look like?

Well, Mail::Sender has something close.  I haven't used that module
before but it looks like this:

    $sender->MailFile({
        to      => $to,
        cc      => $cc,
        subject => 'May 2009 Monthly Report',
        msg     => 'Attached is the report you requested.',
        file    => $spreadsheet_filename,
    });

But, I don't think it does any MIME detection of the file.
That's a bit tricky -- MIME::Types or File::LibMagic could be used.

It's pretty simplistic, but probably a large percentage of email would
be handled by that.  Everything (except subject) takes a scalar or an
array ref.


-- 
Bill Moseley.
mose...@hank.org
Sent from my iMutt

Reply via email to