/usr/share/doc/libspreadsheet-writeexcel-perl/examples/sendmail.pl is in libspreadsheet-writeexcel-perl 2.40-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/usr/bin/perl -w
###############################################################################
#
# Example of how to use Mail::Sender to send a Spreadsheet::WriteExcel Excel
# file as an attachment.
#
# The main thing is to ensure that you close() the Worbook before you send it.
#
# See the L<Mail::Sender> module for further details.
#
# reverse('©'), August 2002, John McNamara, jmcnamara@cpan.org
#
use strict;
use Spreadsheet::WriteExcel;
use Mail::Sender;
# Create an Excel file
my $workbook = Spreadsheet::WriteExcel->new("sendmail.xls");
my $worksheet = $workbook->add_worksheet;
$worksheet->write('A1', "Hello World!");
$workbook->close(); # Must close before sending
# Send the file. Change all variables to suit
my $sender = new Mail::Sender
{
smtp => '123.123.123.123',
from => 'Someone'
};
$sender->MailFile(
{
to => 'another@mail.com',
subject => 'Excel file',
msg => "Here is the data.\n",
file => 'mail.xls',
});
|