I am currently trying to create a batch file which executes several different perl scripts. The last perl script which I need to create will be executed by the batch file, and will automatically attach and e-mail the new "recon.xls" file.
I know that I need to use the Mime::Lite & Net::SMTP packages, however i'm not sure how to send the attchment. This is what I have so far:
use MIME::Lite;
use Net::SMTP;
use MIME::Lite;
$smtp = Net::SMTP->new('mail.whatever.com);
# set up email
$to = "Send_address@whatever.com";
$from = "me@whatever.com";
$subject = "Recon File";
$message = "Attached is the Recon File";
$file = "Newest Recon.xls";
# create a new message
$msg = MIME::Lite->new(
From => $from,
To => $to,
Subject => $subject,
Data => $message
);
Any help would be greatly appreciated!
I know that I need to use the Mime::Lite & Net::SMTP packages, however i'm not sure how to send the attchment. This is what I have so far:
use MIME::Lite;
use Net::SMTP;
use MIME::Lite;
$smtp = Net::SMTP->new('mail.whatever.com);
# set up email
$to = "Send_address@whatever.com";
$from = "me@whatever.com";
$subject = "Recon File";
$message = "Attached is the Recon File";
$file = "Newest Recon.xls";
# create a new message
$msg = MIME::Lite->new(
From => $from,
To => $to,
Subject => $subject,
Data => $message
);
Any help would be greatly appreciated!