below is the code I came up with to get the file data.txt as an attachment and send it out:
Code:
sub test_mail {
my $msg = MIME::Lite->new(
From => 'noreply@faroko.com',
To => 'jamie.henson@faroko.com',
Subject => 'TESTING',
Type => 'multipart/mixed',
);
$msg->attach(
Type => 'TEST',
Data => "TESTING ATTACHMENT FEATURE",
);
$msg->attach(
Type => 'TEST',
Path => 'data.txt',
Filename => 'data.txt',
);
$msg->send;
}