=(Hyperlink("Mailto:me@home.com?Subject=Emailing From Excel&Body=This is a test"))
####
use Spreadsheet::Read; #use only for simply excel files
# take the filename from commandline and try to take in the excel file
my $file1 = ReadData ($excelfile);
# obtain the last line on the first sheet
my $max_row1 = $file1->[1]{maxrow};
# loop through the rows
for (my $i; $i <= $max_row1; $i++) {
# read the name on the cell A $i
my $name = $file1->[1]{cr2cell ( 1, $i)};
# read the file on the cell B $i
my $file = $file1->[1]{cr2cell ( 2, $i)};
}
####
use MIME::Lite;
my $from_address = 'me@home.com';
my $out_server = 'out.home.com';
my $subject = "subject";
my $body = <<"MAIL";
blabla
MAIL
my $document = 'some data' #open and put data into this
my $filename = 'see above'
### Create a new multipart message:
my $msg = MIME::Lite->new(
From => $from_address,
To => $email_address,
Subject => $subject,
Type => 'multipart/mixed'
);
### Add parts (each "attach" has same arguments as "new"):
$msg->attach(
Type => 'TEXT',
Data => $body
);
$msg->attach(
Type => $mime_type,
Data => $document,
Filename => $file,
Disposition => 'attachment'
);
### use Net:SMTP to do the sending. Depends on your system what to use.
eval {$msg->send('smtp', $out_server);}; # via a outbound mailserver
eval {$msg->send();}; # sending via local send command on linux system