MIME::Lite or /bin/mail help please
am 02.11.2007 20:21:03 von Billy PattonI'm trying to get a weekly to be mailed through a cron job.
I have a perl scripts that creates an excel spread sheet.
I want to attach this spread sheet to some mail and send to my group as
my weekly report.
I cat find where I can do an attachment through /bin/mail do Ive tried
MIME::Lite.
What the code does now is that it will make the attachment and send
it,but when it gets there it is empty.
Here's what I have so far:
#!/usr/local/bin/perl
use strict;
use warnings;
use MIME::Lite;
require "ctime.pl";
my $date = ctime ( time );
my $file = '/home/bpatton/c014.report.xls';
chomp $date;
my $msg = MIME::Lite->new(
From => 'bpatton@ti.com' ,
To => 'bpatton@ti.com' ,
Subject => "Weekly from Billy Patton $date",
Type => 'multipart/mixed',
);
$msg->attach(Type => 'TEXT' ,
Data => "See attachment or look at $file" ,
);
$msg->attach(Type => 'AUTO' ,
Filename => $file,
Path => '/home/bpatton',
Disposition => 'attachment' ,
);
$msg->send;