| Server IP : 217.160.0.64 / Your IP : 216.73.216.91 Web Server : Apache System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux User : ws67269618 ( 67269618) PHP Version : 8.4.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /kunden/kunden/proc/self/root/usr/share/doc/libspreadsheet-writeexcel-perl/examples/ |
Upload File : |
#!/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',
});