Emailer search

Purdy on 2001-11-06T13:35:25

I did some research on e-mail tools/API's in Perl and have come to the conclusion that I like MIME::Lite. I also checked out Mail::Sendmail, Mail::Mailer, Net::SMTP and Mail::Send. MIME::Lite just looked better to me.

I was working on an old CGI script that piped to '/usr/lib/sendmail' and thought while I was upgrading it to use CGI.pm to also tackle that. MIME::Lite is very neat. Here's some easy code to compose/send an e-mail:

$msg = MIME::Lite->new(
   To => "purdy\@nc.rr.com",
   From => "purdy\@nc.rr.com",
   Subject => "Hello, World!",
   Data => $emessage
);
$msg->add( "Reply-To" => "purdy\@nc.rr.com" );
$msg->send();

Of course, MIME::Lite has other cool stuff, too, like sending attachments, but perhaps that is for another day. ;)

Jason