in reply to Re: Need a Mail::SendEasy example using attachments
in thread Need a Mail::SendEasy example using attachments

I'm not quite sure why you need to use Net::SMTP in your example, I've had luck with code like the following:
use strict; use warnings; use MIME::Lite; my $msg = MIME::Lite->build( From => 'from@mail.address', To => 'recipient@mail.address', Subject => 'some subject', Type => 'multipart/mixed', ); $msg->attach( Type => 'TEXT', Data => "see attached file\n\n" ); $msg->attach( Type => 'AUTO', # change AUTO to your prefered type if +you wish Path => '/path/to/some/file', ); # MIME::Lite->send('smtp', 'some.smtp.host' ); # don't use sendmail, +see POD $msg->send();

Replies are listed 'Best First'.
Re^3: Need a Mail::SendEasy example using attachments
by roboticus (Chancellor) on Aug 17, 2006 at 03:49 UTC
    duckyd--

    I don't know that I needed it, but after hacking around with it last year, once I got it working, I stopped.

    Next time I have to do some EMail stuff, I'll use your suggestion and tune up the code a bit. Thanks!

    --roboticus