I’m trying to use Perl to send an email message. Basically I have a Perl script that prints out a report in a nice format. I want that report to be sent via email. How can I
MIME::Lite is a strong module used by many. It's easy to use, including if you want to attach documents.
use MIME::Lite;
my $msg = MIME::Lite->new(
From => $from,
To => $to,
Subject => $subject,
Type => 'text/plain',
Data => $message,
);
$msg->send;
Since it uses sendmail by default (as opposed to SMTP), you don't even need to configure it.